Skip to content

@codesoul-co/hypha-adapters-local / sqlite-driver

Using this module

Use the Sqlite driver module for using the public contracts and operations for this capability boundary. It exports 1 function, 3 interfaces.

Import from the package entrypoint

ts
import {
  loadSqlite,
} from '@codesoul-co/hypha-adapters-local';

import type {
  SqliteDatabaseSync,
  SqliteModule,
  SqliteStatementSync,
} from '@codesoul-co/hypha-adapters-local';

Usage patterns

  • Use the 3 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 function as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
loadSqlitefunctionloadSqlite(required?: boolean): SqliteModule | nullLoad Sqlite function with 1 public call signature; parameters and return types are listed below.
SqliteDatabaseSyncinterfaceinterface SqliteDatabaseSyncSqlite Database Sync interface with 3 public fields or methods.
SqliteModuleinterfaceinterface SqliteModuleSqlite Module interface with 1 public fields or methods.
SqliteStatementSyncinterfaceinterface SqliteStatementSyncSqlite Statement Sync interface with 3 public fields or methods.

loadSqlite

Load Sqlite function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { loadSqlite } from '@codesoul-co/hypha-adapters-local';
  • Source module: sqlite-driver

Declaration

text
export declare function loadSqlite(required?: boolean): SqliteModule | null;

Call signature

text
loadSqlite(required?: boolean): SqliteModule | null

Parameters

ParameterTypeRequiredDescription
requiredbooleanNoOptional parameter; accepted values are defined by the type column.

Returns

  • Type: SqliteModule
  • Description: The return contract is defined by the type shown above.

SqliteDatabaseSync

Sqlite Database Sync interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { SqliteDatabaseSync } from '@codesoul-co/hypha-adapters-local';
  • Source module: sqlite-driver

Declaration

text
export interface SqliteDatabaseSync {
    exec(sql: string): void;
    prepare(sql: string): SqliteStatementSync;
    close?(): void;
}

Contract members

MemberKindSignatureDescription
closemethodclose?(): voidPublic method; parameters and return type are shown in the signature.
execmethodexec(sql: string): voidPublic method; parameters and return type are shown in the signature.
preparemethodprepare(sql: string): SqliteStatementSyncPublic method; parameters and return type are shown in the signature.

SqliteModule

Sqlite Module interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { SqliteModule } from '@codesoul-co/hypha-adapters-local';
  • Source module: sqlite-driver

Declaration

text
export interface SqliteModule {
    DatabaseSync: new (filename: string) => SqliteDatabaseSync;
}

Contract members

MemberKindSignatureDescription
DatabaseSyncpropertyDatabaseSync: new (filename: string) => SqliteDatabaseSyncPublic property; its type, readonly modifier and optionality are shown in the signature.

SqliteStatementSync

Sqlite Statement Sync interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { SqliteStatementSync } from '@codesoul-co/hypha-adapters-local';
  • Source module: sqlite-driver

Declaration

text
export interface SqliteStatementSync {
    get(...params: unknown[]): Record<string, unknown> | undefined;
    all(...params: unknown[]): Array<Record<string, unknown>>;
    run(...params: unknown[]): unknown;
}

Contract members

MemberKindSignatureDescription
allmethodall(...params: unknown[]): Array<Record<string, unknown>>Public method; parameters and return type are shown in the signature.
getmethodget(...params: unknown[]): Record<string, unknown> | undefinedPublic method; parameters and return type are shown in the signature.
runmethodrun(...params: unknown[]): unknownPublic method; parameters and return type are shown in the signature.