mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) updates from grist-core
This commit is contained in:
@@ -84,6 +84,12 @@ export const TablesPatch = t.iface([], {
|
||||
"tables": t.tuple("RecordWithStringId", t.rest(t.array("RecordWithStringId"))),
|
||||
});
|
||||
|
||||
export const SqlPost = t.iface([], {
|
||||
"sql": "string",
|
||||
"args": t.opt(t.array("any")),
|
||||
"timeout": t.opt("number"),
|
||||
});
|
||||
|
||||
const exportedTypeSuite: t.ITypeSuite = {
|
||||
NewRecord,
|
||||
NewRecordWithStringId,
|
||||
@@ -101,5 +107,6 @@ const exportedTypeSuite: t.ITypeSuite = {
|
||||
TablePost,
|
||||
TablesPost,
|
||||
TablesPatch,
|
||||
SqlPost,
|
||||
};
|
||||
export default exportedTypeSuite;
|
||||
|
||||
@@ -107,3 +107,16 @@ export interface TablesPost {
|
||||
export interface TablesPatch {
|
||||
tables: [RecordWithStringId, ...RecordWithStringId[]]; // at least one table is required
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON schema for the body of api /sql POST endpoint
|
||||
*/
|
||||
export interface SqlPost {
|
||||
sql: string;
|
||||
args?: any[]; // (It would be nice to support named parameters, but
|
||||
// that feels tricky currently with node-sqlite3)
|
||||
timeout?: number; // In msecs. Can only be reduced from server default,
|
||||
// not increased. Note timeout of a query could affect
|
||||
// other queued queries on same document, because of
|
||||
// limitations of API node-sqlite3 exposes.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user