Open sammysium opened 4 years ago
H
I am doing a simple insert query that contains different data types (if it matters) and i get the error "plugin.warn is not a function": where data is a dictionary object passed to the method.
is_active, status,user_id are integers all the rest are strings.
var dt = new Date(); db.transaction(function(tx) { tx.executeSql('INSERT INTO client (auto_id,user_id,username,first_name,last_name,email,is_active,date_joined,status,birthdate,marital_status,gender,phone,identification,nationality,lang,syncedon) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', [ auto_id,0,data.username,data.firstName,data.lastName,data.email,0,dt,1,data.birthdate,data.maritalStatus,data.gender,data.phone,data.idnumber,data.nation,data.lang,null ] ); }, function(error) { console.log('Transaction ERROR: ' + error.message); reject(false) }, function() { console.log('Populated database OK'); resolve(true) });
There are few examples on data manipulation. Am I even doing the insert right?
Hi @sammysium remove new Data(). it will work
I'm hitting this as well! Triggering an error on this line: https://github.com/andpor/react-native-sqlite-storage/blob/4.1.0/lib/sqlite.core.js#L507 by doing something like:
const listOfThings = ['foo', 'bar']
typeormConn
.getRepository(SomeRepo)
.createQueryBuilder('somerepo')
.leftJoinAndSelect(
'somerepo.otherrepo',
'otherrepo',
)
// otherrepo.things is of type "simple-json"
.where('otherrepo.things = :listOfThings', { listOfThings })
.getMany()
I'm also getting this same error. Doing a simple insert similar to @sammysium. The function call used to work until I updated my project from using react-native-sqlite-storage 3.3.11 to 5.0.0.
same problem.. my project update from react-native-sqlite-storage 3.3.3 to 5.0.0, RN0.62.2
thanks @mnzaki remove this line fixed for me 👍 💯 👯
plugin.warn('addStatement - parameter of type <'+t+'> converted to string using toString()')
Same issue happen at insert query
I was getting this error with Date objects, I fixed it with date.toString();
I am doing a simple insert query that contains different data types (if it matters) and i get the error "plugin.warn is not a function": where data is a dictionary object passed to the method.
is_active, status,user_id are integers all the rest are strings.
There are few examples on data manipulation. Am I even doing the insert right?