-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
34 lines (34 loc) · 1.26 KB
/
index.d.ts
File metadata and controls
34 lines (34 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import SQLite from 'react-native-sqlite-storage';
/**
* Code util
*/
export declare class CodeTool {
static isStringEmpty(str?: string): boolean;
static waitTime(time: number | 0): Promise<unknown>;
}
/**
* Base class from components to extend
*/
export declare class SqlLite<T> {
hasInit: boolean;
dbName: string;
db: SQLite.SQLiteDatabase | undefined;
tableName: string;
primaryKey: string;
createTableSql: string;
constructor();
initTable(): Promise<unknown>;
executeSql(sql: string, isInit?: boolean): Promise<unknown>;
init(): Promise<void>;
open(dbName: string): SQLite.SQLiteDatabase;
createTable(createTableSql: string): Promise<unknown>;
checkAndCreateColumn(columnName: string, createColumnSql: string): Promise<boolean>;
insert(item: T): Promise<unknown>;
updateByCondition(newParams: T, conditionParams: T): Promise<boolean>;
updateByPrimaryKey(newParams: T | any): Promise<boolean>;
deleteByPrimaryKey(primaryValue: any): Promise<boolean>;
selectByPrimaryKey(primaryValue: string | undefined | null): Promise<T | null>;
select(selectSql?: string, orderSql?: string): Promise<[] | T[]>;
selectBySql(selectSql: string): Promise<any>;
selectOne(selectSql?: string): Promise<T | null>;
}