Major version update. Major bugfixes. Security vulnerabilites fixed
This commit is contained in:
Vendored
+18
-6
@@ -1,3 +1,4 @@
|
||||
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";
|
||||
@@ -5,15 +6,26 @@ 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";
|
||||
/**
|
||||
* Initialize lazily on first call, so importing the library never throws.
|
||||
* Setup errors (missing config / schema) reject the call instead.
|
||||
*/
|
||||
function withInit(fn) {
|
||||
return (async (...args) => {
|
||||
init();
|
||||
return fn(...args);
|
||||
});
|
||||
}
|
||||
const BunSQLite = {
|
||||
select: DbSelect,
|
||||
insert: DbInsert,
|
||||
update: DbUpdate,
|
||||
delete: DbDelete,
|
||||
sql: DbSQL,
|
||||
select: withInit(DbSelect),
|
||||
insert: withInit(DbInsert),
|
||||
update: withInit(DbUpdate),
|
||||
delete: withInit(DbDelete),
|
||||
sql: withInit(DbSQL),
|
||||
utils: {
|
||||
grab_db_schema: grabDbSchema,
|
||||
grab_db_schema: withInit(grabDbSchema),
|
||||
grab_join_fields_from_query_object: grabJoinFieldsFromQueryObject,
|
||||
},
|
||||
};
|
||||
export default BunSQLite;
|
||||
export { UsersOmitedFields, MariaDBCollations, TextFieldTypesArray, BUN_SQLITE_DATATYPES, ServerQueryOperators, ServerQueryEqualities, SQlComparisons, DataCrudRequestMethods, DataCrudRequestMethodsLowerCase, DsqlCrudActions, QueryFields, DockerComposeServices, IndexTypes, DefaultFields, } from "./types";
|
||||
|
||||
Reference in New Issue
Block a user