@@ -18,7 +18,6 @@ import {
1818 objNew ,
1919 objValues ,
2020} from '../../common/obj' ;
21- import { SINGLE_ROW_ID , escapeId } from './common' ;
2221import {
2322 arrayFilter ,
2423 arrayIsEmpty ,
@@ -32,6 +31,7 @@ import {isUndefined, promiseAll} from '../../common/other';
3231import { setAdd , setNew } from '../../common/set' ;
3332import { Id } from '../../types/common' ;
3433import { Table } from '../../types/store' ;
34+ import { escapeId } from './common' ;
3535
3636export type Cmd = ( sql : string , args ?: any [ ] ) => Promise < IdObj < any > [ ] > ;
3737type Schema = IdMap2 < string > ;
@@ -45,10 +45,6 @@ export const getCommandFunctions = (
4545 managedTableNames : string [ ] ,
4646) : [
4747 refreshSchema : ( ) => Promise < Schema > ,
48- loadSingleRowTable : (
49- tableName : string ,
50- rowIdColumnName : string ,
51- ) => Promise < IdObj < any > | null > ,
5248 loadTable : ( tableName : string , rowIdColumnName : string ) => Promise < Table > ,
5349 saveTable : (
5450 tableName : string ,
@@ -112,23 +108,6 @@ export const getCommandFunctions = (
112108 ( _ , name ) => mapSet ( schemaMap , name ) ,
113109 ) ;
114110
115- const loadSingleRowTable = async (
116- tableName : string ,
117- rowIdColumnName : string ,
118- ) : Promise < IdObj < any > | null > => {
119- const rows = canSelect ( tableName , rowIdColumnName )
120- ? await cmd (
121- SELECT_STAR_FROM +
122- escapeId ( tableName ) +
123- WHERE +
124- escapeId ( rowIdColumnName ) +
125- '=?' ,
126- [ SINGLE_ROW_ID ] ,
127- )
128- : [ ] ;
129- return arrayIsEmpty ( rows ) ? null : objDel ( rows [ 0 ] , rowIdColumnName ) ;
130- } ;
131-
132111 const loadTable = async (
133112 tableName : string ,
134113 rowIdColumnName : string ,
@@ -273,7 +252,7 @@ export const getCommandFunctions = (
273252 }
274253 } ;
275254
276- return [ refreshSchema , loadSingleRowTable , loadTable , saveTable ] ;
255+ return [ refreshSchema , loadTable , saveTable ] ;
277256} ;
278257
279258const upsert = async (
0 commit comments