view deita/d_connection.c @ 278:8d560f50ed4c

Improve infinite canvas interactions and browser chrome Render Lucide icons directly with Raylib, add searchable icon browsing, robust text editing, entity lifecycle animations, z-order-safe input, semantic themes, and animated editable browser controls. Document rendering, pinning, context, and component extension for future agents. Co-authored-by: Copilot <[email protected]> Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:16:14 -0700
parents ae6a88e6e484
children
line wrap: on
line source

#include "deita_internal.h"
#include <stdio.h>
#include <stdlib.h>

Deita_Connection* Deita_Connection_Create(
  Deita_Database_Type database_type,
  const char *connection_string)
{
  if (database_type == DEITA_DATABASE_TYPE_SQLITE3)
    return deita__sqlite_connection_create(connection_string);

  fprintf(stderr, "Deita_Connection_Create: Unsupported database type %d\n", database_type);
  return NULL;
}

void Deita_Connection_Close(Deita_Connection *p_connection)
{
  if (!p_connection)
    return;

  if (p_connection->database_type == DEITA_DATABASE_TYPE_SQLITE3)
  {
    deita__sqlite_connection_close(p_connection);
    return;
  }

  fprintf(stderr, "Deita_Connection_Close: Unsupported database type %d\n", p_connection->database_type);
}

boolean Deita_Connection_Is_Open(Deita_Connection *p_connection)
{
  if (!p_connection)
    return FALSE;

  if (p_connection->database_type == DEITA_DATABASE_TYPE_SQLITE3)
    return deita__sqlite_connection_is_open(p_connection);

  fprintf(stderr, "Deita_Connection_Is_Open: Unsupported database type %d\n", p_connection->database_type);
  return FALSE;
}