react-sqlite-hook
Advanced tools
Comparing version 0.0.1-alpha.2 to 0.0.1-beta.1
{ | ||
"name": "react-sqlite-hook", | ||
"version": "0.0.1-alpha.1", | ||
"version": "0.0.1-alpha.2", | ||
"description": "React Hook for @Capacitor-community/sqlite plugin", | ||
@@ -5,0 +5,0 @@ "repository": { |
import { AvailableResult } from './util/models'; | ||
interface SQLSet { | ||
statement: string; | ||
values: [any]; | ||
} | ||
interface SQLiteResult extends AvailableResult { | ||
@@ -26,3 +22,3 @@ openDB: (dbName: string, encrypted?: boolean, mode?: string) => Promise<{ | ||
}>; | ||
executeSet: (set: [SQLSet]) => Promise<{ | ||
executeSet: (set: Array<any>) => Promise<{ | ||
changes?: { | ||
@@ -29,0 +25,0 @@ changes: number; |
@@ -90,4 +90,4 @@ //Inspired from https://github.com/capacitor-community/react-hooks/blob/master/src/storage/ | ||
/** | ||
* Execute a set of Raw Statements as Array<SQLSet> | ||
* @param set Array<SQLSet> | ||
* Execute a set of Raw Statements as Array<any> | ||
* @param set Array<any> | ||
*/ | ||
@@ -94,0 +94,0 @@ const executeSet = useCallback(async (set) => { |
{ | ||
"name": "react-sqlite-hook", | ||
"version": "0.0.1-alpha.2", | ||
"version": "0.0.1-beta.1", | ||
"description": "React Hook for @Capacitor-community/sqlite plugin", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -9,6 +9,3 @@ //Inspired from https://github.com/capacitor-community/react-hooks/blob/master/src/storage/ | ||
interface SQLSet { | ||
statement: string; | ||
values : [any]; | ||
} | ||
interface SQLiteResult extends AvailableResult { | ||
@@ -19,3 +16,3 @@ openDB: (dbName:string,encrypted?:boolean,mode?:string) => Promise<{result?: boolean, message?: string}>; | ||
execute: (statements: string) => Promise<{changes?:{changes:number},message?:string}>; | ||
executeSet: (set:[SQLSet]) => Promise<{changes?:{changes:number,lastId:number},message?:string}>; | ||
executeSet: (set:Array<any>) => Promise<{changes?:{changes:number,lastId:number},message?:string}>; | ||
run: (statement:string,values?:Array<any>) => Promise<{changes?:{changes:number,lastId:number},message?:string}>; | ||
@@ -129,6 +126,6 @@ query: (statement:string,values?:Array<string>) => Promise<{values?:Array<any>,message?:string}> | ||
/** | ||
* Execute a set of Raw Statements as Array<SQLSet> | ||
* @param set Array<SQLSet> | ||
* Execute a set of Raw Statements as Array<any> | ||
* @param set Array<any> | ||
*/ | ||
const executeSet = useCallback(async (set:[SQLSet]) => { | ||
const executeSet = useCallback(async (set:Array<any>) => { | ||
if(set.length > 0) { | ||
@@ -135,0 +132,0 @@ const r = await mSQLite.executeSet({set:set}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54349
855