@saltcorn/sqlite
Advanced tools
Comparing version 0.6.2-beta.4 to 0.6.2-beta.5
@@ -7,2 +7,3 @@ /** | ||
import { Database } from "sqlite3"; | ||
import type { Value, Where, SelectOptions, Row } from "@saltcorn/db-common/internal"; | ||
/** | ||
@@ -36,3 +37,3 @@ * Initializes internals of the the sqlite module. | ||
*/ | ||
export declare function sql_log(sql: string, vs?: any): void; | ||
export declare function sql_log(sql: string, vs?: Value[]): void; | ||
/** | ||
@@ -43,3 +44,3 @@ * @param {string} sql | ||
*/ | ||
export declare function query(sql: string, params?: any): Promise<any>; | ||
export declare function query(sql: string, params?: Value[]): Promise<any>; | ||
/** | ||
@@ -66,3 +67,3 @@ * Change connection (close connection and open new connection from connObj) | ||
*/ | ||
export declare const select: (tbl: string, whereObj: any, selectopts?: any) => Promise<any>; | ||
export declare const select: (tbl: string, whereObj: Where, selectopts?: SelectOptions) => Promise<Row[]>; | ||
/** | ||
@@ -81,3 +82,3 @@ * @param {any} v | ||
*/ | ||
export declare const mkVal: ([k, v]: [any, any]) => string; | ||
export declare const mkVal: ([k, v]: [string, any]) => Value; | ||
/** | ||
@@ -91,3 +92,3 @@ * Drop unique constraint | ||
*/ | ||
export declare const update: (tbl: string, obj: any, id: string) => Promise<void>; | ||
export declare const update: (tbl: string, obj: Row, id: string | number) => Promise<void>; | ||
/** | ||
@@ -100,3 +101,3 @@ * Delete rows in table | ||
*/ | ||
export declare const deleteWhere: (tbl: string, whereObj: any) => Promise<void>; | ||
export declare const deleteWhere: (tbl: string, whereObj: Where) => Promise<void>; | ||
/** | ||
@@ -110,3 +111,5 @@ * Insert rows into table | ||
*/ | ||
export declare const insert: (tbl: string, obj: any, opts?: any) => Promise<string | void>; | ||
export declare const insert: (tbl: string, obj: Row, opts?: { | ||
noid?: boolean; | ||
}) => Promise<string | void>; | ||
/** | ||
@@ -120,3 +123,3 @@ * Select one record | ||
*/ | ||
export declare const selectOne: (tbl: string, where: any) => Promise<any>; | ||
export declare const selectOne: (tbl: string, where: Where) => Promise<Row>; | ||
/** | ||
@@ -129,3 +132,3 @@ * Select one record or null if no records | ||
*/ | ||
export declare const selectMaybeOne: (tbl: string, where: any) => Promise<any>; | ||
export declare const selectMaybeOne: (tbl: string, where: Where) => Promise<Row | null>; | ||
/** | ||
@@ -138,3 +141,3 @@ * Get count of rows in table | ||
*/ | ||
export declare const count: (tbl: string, whereObj: any) => Promise<number>; | ||
export declare const count: (tbl: string, whereObj: Where) => Promise<number>; | ||
/** | ||
@@ -141,0 +144,0 @@ * Get version of PostgreSQL |
@@ -194,5 +194,3 @@ "use strict"; | ||
const kvs = Object.entries(obj); | ||
const fnameList = kvs | ||
.map(([k, v]) => `"${(0, internal_1.sqlsanitize)(k)}"`) | ||
.join(); | ||
const fnameList = kvs.map(([k, v]) => `"${(0, internal_1.sqlsanitize)(k)}"`).join(); | ||
const valPosList = kvs | ||
@@ -199,0 +197,0 @@ .map(([k, v], ix) => v && v.next_version_by_id |
{ | ||
"name": "@saltcorn/sqlite", | ||
"version": "0.6.2-beta.4", | ||
"version": "0.6.2-beta.5", | ||
"description": "Sqlite structures for Saltcorn, open-source no-code platform", | ||
@@ -28,3 +28,3 @@ "homepage": "https://saltcorn.com", | ||
"dependencies": { | ||
"@saltcorn/db-common": "0.6.2-beta.4", | ||
"@saltcorn/db-common": "0.6.2-beta.5", | ||
"sqlite3": "^5.0.2" | ||
@@ -31,0 +31,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
44959
504
+ Added@saltcorn/db-common@0.6.2-beta.5(transitive)
+ Added@saltcorn/markup@0.6.2-beta.5(transitive)
- Removed@saltcorn/db-common@0.6.2-beta.4(transitive)
- Removed@saltcorn/markup@0.6.2-beta.4(transitive)