view deita/d_connection.c @ 275:78699f810817

Add Qwen3-VL and WebRTC dictation services Add Bazel targets for the CUDA-backed Qwen3-VL server and a local WebRTC faster-whisper dictation service. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3d8cb06-6c95-4ae0-9757-651d3796ab00
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 10:58:47 -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;
}