view deita/d_connection.c @ 279:b3b547563ec7

Add Google connector service and agent wiki Implement the C/Seobeo Google Drive and Gmail connector with encrypted OAuth storage, Zenbu authentication, browser testing, AI tool discovery, chunked HTTP decoding, and Bazel coverage. Consolidate repository guidance into progressive wiki documentation and enforce arena-first allocation for new first-party C code. Co-authored-by: Copilot <[email protected]> Copilot-Session: 84c338fd-0939-4bb3-b7f3-1062eb213e5d
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:22:36 -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;
}