quality / commitlint (push) Skipped
CD / update-wiki (push) Failing after 7s
quality / changes (push) Successful in 4s
quality / docker-check (push) Skipped
quality / web (push) Failing after 38s
quality / api (push) Successful in 49s
CD / quality (push) Failing after 1m36s
CD / publish (push) Skipped
202 lines
6.8 KiB
TypeScript
202 lines
6.8 KiB
TypeScript
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
import Database from 'better-sqlite3';
|
|
import { drizzle } from 'drizzle-orm/better-sqlite3';
|
|
|
|
declare const appSettings: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
name: "app_settings";
|
|
schema: undefined;
|
|
columns: {
|
|
id: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
name: "id";
|
|
tableName: "app_settings";
|
|
dataType: "string";
|
|
columnType: "SQLiteText";
|
|
data: string;
|
|
driverParam: string;
|
|
notNull: true;
|
|
hasDefault: false;
|
|
isPrimaryKey: true;
|
|
isAutoincrement: false;
|
|
hasRuntimeDefault: false;
|
|
enumValues: [string, ...string[]];
|
|
baseColumn: never;
|
|
identity: undefined;
|
|
generated: undefined;
|
|
}, {}, {
|
|
length: number | undefined;
|
|
}>;
|
|
show_quick_actions: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
name: "show_quick_actions";
|
|
tableName: "app_settings";
|
|
dataType: "boolean";
|
|
columnType: "SQLiteBoolean";
|
|
data: boolean;
|
|
driverParam: number;
|
|
notNull: true;
|
|
hasDefault: true;
|
|
isPrimaryKey: false;
|
|
isAutoincrement: false;
|
|
hasRuntimeDefault: false;
|
|
enumValues: undefined;
|
|
baseColumn: never;
|
|
identity: undefined;
|
|
generated: undefined;
|
|
}, {}, {}>;
|
|
created_at: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
name: "created_at";
|
|
tableName: "app_settings";
|
|
dataType: "string";
|
|
columnType: "SQLiteText";
|
|
data: string;
|
|
driverParam: string;
|
|
notNull: true;
|
|
hasDefault: true;
|
|
isPrimaryKey: false;
|
|
isAutoincrement: false;
|
|
hasRuntimeDefault: false;
|
|
enumValues: [string, ...string[]];
|
|
baseColumn: never;
|
|
identity: undefined;
|
|
generated: undefined;
|
|
}, {}, {
|
|
length: number | undefined;
|
|
}>;
|
|
updated_at: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
name: "updated_at";
|
|
tableName: "app_settings";
|
|
dataType: "string";
|
|
columnType: "SQLiteText";
|
|
data: string;
|
|
driverParam: string;
|
|
notNull: true;
|
|
hasDefault: true;
|
|
isPrimaryKey: false;
|
|
isAutoincrement: false;
|
|
hasRuntimeDefault: false;
|
|
enumValues: [string, ...string[]];
|
|
baseColumn: never;
|
|
identity: undefined;
|
|
generated: undefined;
|
|
}, {}, {
|
|
length: number | undefined;
|
|
}>;
|
|
};
|
|
dialect: "sqlite";
|
|
}>;
|
|
declare const schema: {
|
|
appSettings: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
name: "app_settings";
|
|
schema: undefined;
|
|
columns: {
|
|
id: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
name: "id";
|
|
tableName: "app_settings";
|
|
dataType: "string";
|
|
columnType: "SQLiteText";
|
|
data: string;
|
|
driverParam: string;
|
|
notNull: true;
|
|
hasDefault: false;
|
|
isPrimaryKey: true;
|
|
isAutoincrement: false;
|
|
hasRuntimeDefault: false;
|
|
enumValues: [string, ...string[]];
|
|
baseColumn: never;
|
|
identity: undefined;
|
|
generated: undefined;
|
|
}, {}, {
|
|
length: number | undefined;
|
|
}>;
|
|
show_quick_actions: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
name: "show_quick_actions";
|
|
tableName: "app_settings";
|
|
dataType: "boolean";
|
|
columnType: "SQLiteBoolean";
|
|
data: boolean;
|
|
driverParam: number;
|
|
notNull: true;
|
|
hasDefault: true;
|
|
isPrimaryKey: false;
|
|
isAutoincrement: false;
|
|
hasRuntimeDefault: false;
|
|
enumValues: undefined;
|
|
baseColumn: never;
|
|
identity: undefined;
|
|
generated: undefined;
|
|
}, {}, {}>;
|
|
created_at: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
name: "created_at";
|
|
tableName: "app_settings";
|
|
dataType: "string";
|
|
columnType: "SQLiteText";
|
|
data: string;
|
|
driverParam: string;
|
|
notNull: true;
|
|
hasDefault: true;
|
|
isPrimaryKey: false;
|
|
isAutoincrement: false;
|
|
hasRuntimeDefault: false;
|
|
enumValues: [string, ...string[]];
|
|
baseColumn: never;
|
|
identity: undefined;
|
|
generated: undefined;
|
|
}, {}, {
|
|
length: number | undefined;
|
|
}>;
|
|
updated_at: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
name: "updated_at";
|
|
tableName: "app_settings";
|
|
dataType: "string";
|
|
columnType: "SQLiteText";
|
|
data: string;
|
|
driverParam: string;
|
|
notNull: true;
|
|
hasDefault: true;
|
|
isPrimaryKey: false;
|
|
isAutoincrement: false;
|
|
hasRuntimeDefault: false;
|
|
enumValues: [string, ...string[]];
|
|
baseColumn: never;
|
|
identity: undefined;
|
|
generated: undefined;
|
|
}, {}, {
|
|
length: number | undefined;
|
|
}>;
|
|
};
|
|
dialect: "sqlite";
|
|
}>;
|
|
};
|
|
|
|
type Sqlite = Database.Database;
|
|
type Db = ReturnType<typeof drizzle<typeof schema>>;
|
|
declare function resolveDatabasePath(databaseUrl: string): string;
|
|
declare function createDb(databaseUrl: string): {
|
|
db: Db;
|
|
sqlite: Sqlite;
|
|
};
|
|
declare function createMemoryDb(): {
|
|
db: Db;
|
|
sqlite: Sqlite;
|
|
};
|
|
declare function runMigrations(sqlite: Sqlite): void;
|
|
declare function healthCheck(sqlite: Sqlite): void;
|
|
|
|
declare class NotFoundError extends Error {
|
|
constructor(message: string);
|
|
}
|
|
declare class ConflictError extends Error {
|
|
constructor(message: string);
|
|
}
|
|
|
|
type AppSettingsDto = {
|
|
id: string;
|
|
showQuickActions: boolean;
|
|
};
|
|
type AppSettingsPatch = {
|
|
showQuickActions?: boolean;
|
|
};
|
|
declare function getAppSettings(db: Db): AppSettingsDto;
|
|
declare function updateAppSettings(db: Db, patch: AppSettingsPatch): AppSettingsDto;
|
|
|
|
export { type AppSettingsDto, type AppSettingsPatch, ConflictError, type Db, NotFoundError, type Sqlite, appSettings, createDb, createMemoryDb, getAppSettings, healthCheck, resolveDatabasePath, runMigrations, schema, updateAppSettings };
|