You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
README contains wrong examples of using the library (or the types need to be reviewed, you decide).
If we take the Simple queries example:
try{constdb=open('myDb.sqlite');const{ rows }=db.execute('SELECT somevalue FROM sometable');rows.forEach((row)=>{console.log(row);});let{ rowsAffected }=awaitdb.executeAsync('UPDATE sometable SET somecolumn = ? where somekey = ?',[0,1],);console.log(`Update affected ${rowsAffected} rows`);}catch(e){console.error('Something went wrong executing SQL commands:',e.message);}
open function doesn't accept a string, but a { name: string; location?: string; } object
rows might be undefined and is not an array, it's:
rows?: {/** Raw array with all dataset */
_array: any[];/** The lengh of the dataset */
length: number;/** A convenience function to acess the index based the row object * @param idx the row index * @returns the row structure identified by column names */
item: (idx: number)=>any;};
(taken from the QueryResult type)
I would expect rows to be an array, so I'd like the types to be reviewed, but I'm not sure it's in scope.
Fixing the examples is quicker, for sure.
Interestingly, no one else complained; the same code is present in the old repo.
What do you think?
The text was updated successfully, but these errors were encountered:
You are right insofar that the example in the readme is wrong. That was from the first implementation. The API however is complaint to webSQL, that's also why expo-sqlite also returns it. webSQL is dead though, so the specification is only for legacy purposes as a lot of libraries consume it.
Hi,
Library version
8.0.4
Issue
README contains wrong examples of using the library (or the types need to be reviewed, you decide).
If we take the Simple queries example:
open
function doesn't accept a string, but a{ name: string; location?: string; }
objectrows
might be undefined and is not an array, it's:(taken from the
QueryResult
type)I would expect
rows
to be an array, so I'd like the types to be reviewed, but I'm not sure it's in scope.Fixing the examples is quicker, for sure.
Interestingly, no one else complained; the same code is present in the old repo.
What do you think?
The text was updated successfully, but these errors were encountered: