- init() loads config, schema and the SQLite client once into globals - all CRUD queries go through lib/db-handler.ts (optional per-call config) - split db-schema-manager.ts into lib/schema/* with FK-aware table ordering - add bun:test tests for schema ordering, FK constraints and schema sync - config/schema files can be .ts/.js/.json/.yaml/.yml; db_schema_file_name is now optional (defaults to schema.* in db_dir) - add export/import commands (database snapshot + schema archives) - package exports map, type re-exports, hardened publish.sh - validate table name in delete Co-Authored-By: Claude Opus 5.5 <[email protected]>
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import init from "./functions/init";
|
|
import DbDelete from "./lib/sqlite/db-delete";
|
|
import DbInsert from "./lib/sqlite/db-insert";
|
|
import DbSelect from "./lib/sqlite/db-select";
|
|
import DbSQL from "./lib/sqlite/db-sql";
|
|
import DbUpdate from "./lib/sqlite/db-update";
|
|
import grabDbSchema from "./utils/grab-db-schema";
|
|
import grabJoinFieldsFromQueryObject from "./utils/grab-join-fields-from-query-object";
|
|
|
|
init();
|
|
|
|
const BunSQLite = {
|
|
select: DbSelect,
|
|
insert: DbInsert,
|
|
update: DbUpdate,
|
|
delete: DbDelete,
|
|
sql: DbSQL,
|
|
utils: {
|
|
grab_db_schema: grabDbSchema,
|
|
grab_join_fields_from_query_object: grabJoinFieldsFromQueryObject,
|
|
},
|
|
} as const;
|
|
|
|
export default BunSQLite;
|
|
|
|
export type * from "./types";
|
|
export {
|
|
UsersOmitedFields,
|
|
MariaDBCollations,
|
|
TextFieldTypesArray,
|
|
BUN_SQLITE_DATATYPES,
|
|
ServerQueryOperators,
|
|
ServerQueryEqualities,
|
|
SQlComparisons,
|
|
DataCrudRequestMethods,
|
|
DataCrudRequestMethodsLowerCase,
|
|
DsqlCrudActions,
|
|
QueryFields,
|
|
DockerComposeServices,
|
|
IndexTypes,
|
|
DefaultFields,
|
|
} from "./types";
|