This example has moved to examples/with-sqlite
expo / sqlite-example Goto Github PK
View Code? Open in Web Editor NEWThis example has moved
Home Page: https://github.com/expo/examples/tree/master/with-sqlite
This example has moved
Home Page: https://github.com/expo/examples/tree/master/with-sqlite
This example has moved to examples/with-sqlite
Hi, I'm really new so I'm not so sure if this is correct but I got this error:
TypeError: undefined is not an object (evaluating '_expoSqlite.SQLite.openDatabase')
Googled and found an issue on another repo: typeorm/typeorm#4846
And I think it has to do with line 11 App.js:
import { SQLite } from 'expo-sqlite
Even in the Expo docs on SQLite says we should call the API like so:
import * as SQLite from 'expo-sqlite';
Really minor thing, but would appreciate you fixing this. (or maybe clarification if this is intentional)
Thank you!
"this" is a problem according to the debugger:
It works in XDE but I get 2 warnings:
Warning: PropTypes has been moved to a separate package. Accessing React.PropTypes is no longer supported and will be removed completely in React 16. Use the prop-types package on npm instead. (https://fb.me/migrating-from-react-proptypes)
14:50:45
Warning: React.createClass is no longer supported. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement. (https://fb.me/migrating-from-react-create-class)
Would be great to have it in snack! ;)
Is there an option of pre-filled database? or probably easy approach to dump existing sqlite db?
i need to insert thousands row, i use db.transaction like the example but it return error after 3000 row,
this is my sql execution... i need to start begin transaction to execute big data , how i can do that?
var multiQuery = []
lasti=0
for (let i = 0; i < result.length; i++) {
const l = result[i];
if (i === 0 || i % 999 == 0) {
query = 'INSERT INTO ' + LocationDB.table + ' (' + fields + ') VALUES '
lasti = i
}
query += '(' + "'" + l.join("','") + "'" + '),'
if (i === result.length - 1 || i === (lasti + 998)) {
query = query.slice(0, -1)
query += ';'
}
multiQuery.push(query)
}
execute(multiQuery)
function execute(sqlStatement, callback) {
var output = ''
config.console('execute() => ', sqlStatement)
if (this.db) {
this.db.transaction((tx) => {
if (Array.isArray(sqlStatement)) {
sqlStatement.map((query) => {
tx.executeSql(query, [], (transaction, result) => {
if (callback) callback(result)
}, (eror) => config.console(eror))
})
} else {
tx.executeSql(sqlStatement, [], (transaction, result) => {
if (callback) callback(result)
}, (eror) => config.console("execute() error =>", eror))
}
})
} else {
config.console('db is undefined')
}
}
Does SQLite in expo.io have left join expressions?
I tried to do this one:
SELECT directions.r_id as r_id, routes.id as route_id FROM directions LEFT JOIN routes ON r_id = route_id;
But I failed.
{"_websqlDatabase":{"version":"1.0","_db":{"_name":"goes_db"},"_txnQueue":{"length":0},"_running":true,"_currentTask":{"readOnly":false}},"_error":null,"_complete":false,"_runningTimeout":false,"_sqlQueue":{"length":0},"_running":true}
Correct to:
import * as SQLite from 'expo-sqlite';
for v.35 and SQLite 7.0.0
Can you show me the steps to use SQLite on expo
I'm sorry, I know it's not the right place to post but I just want to know if Expo has any working on db protection, e.g. SqlCipher. Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.