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
Copy file name to clipboardExpand all lines: README.md
+12-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -27,12 +27,13 @@ Inspired/compatible with [react-native-sqlite-storage](https://github.com/andpor
27
27
28
28
## Gotchas
29
29
30
-
-**It's not possible to use a browser to debug a JSI app**, use [Flipper](https://github.com/facebook/flipper) (on android Flipper also has an integrated SQLite Database explorer).
30
+
-**Javascript cannot represent intergers larger than 53 bits**, be careful when loading data if it came from other systems. [Read more](https://github.com/ospfranco/react-native-quick-sqlite/issues/16#issuecomment-1018412991).
31
+
-**It's not possible to use a browser to debug a JSI app**, use [Flipper](https://github.com/facebook/flipper) (for android Flipper also has SQLite Database explorer).
31
32
- Your app will now include C++, you will need to install the NDK on your machine for android.
32
33
- This library supports SQLite BLOBs which are mapped to JS ArrayBuffers, check out the sample project on how to use it
34
+
- From version 2.0.0 onwards errors are no longer thrown on invalid SQL statements. The response contains a `status` number, `0` signals correct execution, `1` signals an error.
35
+
- From version 3.0.0 onwards no JS errors are thown, every operation returns an object with a `status` field.
33
36
- If you want to run the example project on android, you will have to change the paths on the android/CMakeLists.txt file, they are already there, just uncomment them.
34
-
- Starting with version 2.0.0 the library no longer throws errors when an invalid statement is passed, but returns a status (0 or 1) field in the response.
35
-
- This library cannot retrieve integers larger than 53 bits because it's not possible to represent such numbers in JavaScript. [Read more](https://github.com/ospfranco/react-native-quick-sqlite/issues/16#issuecomment-1018412991).
36
37
37
38
## Use TypeORM
38
39
@@ -76,19 +77,19 @@ interface ISQLite {
76
77
In your code
77
78
78
79
```typescript
79
-
// If you want to register the (globalThis) types for the low level API do an empty import
80
80
import'react-native-quick-sqlite';
81
81
82
82
// `sqlite` is a globally registered object, so you can directly call it from anywhere in your javascript
83
-
// The methods `throw` when an execution error happens, so try/catch them
84
-
try {
85
-
sqlite.open('myDatabase', 'databases');
86
-
} catch (e) {
87
-
console.log(e); // [react-native-quick-sqlite]: Could not open database file: ERR XXX
83
+
// the import on the top of the file only registers typescript types but it is not mandatory
let result =sqlite.executeSql('myDatabase', 'SELECT somevalue FROM sometable');
@@ -129,7 +130,7 @@ if (!result.status) {
129
130
130
131
## Learn React Native JSI
131
132
132
-
If you want to learn how to make your own JSI module and also get a reference guide for all things C++/JSI you can buy my [JSI/C++ Cheatsheet](http://ospfranco.gumroad.com/l/IeeIvl)
133
+
If you want to learn how to make your own JSI module buy my [JSI/C++ Cheatsheet](http://ospfranco.gumroad.com/l/IeeIvl), I'm also available for [freelance work](mailto:[email protected]?subject=Freelance)!
0 commit comments