| #
c4573fff |
| 08-Sep-2023 |
Kudo Chien <[email protected]> |
[sqlite] only return successful result from executeSqlAsync (#24336)
# Why
only return successful `ResultSet` from `executeSqlAsync`
fixes #23884
# How
as commented at https://github.com/e
[sqlite] only return successful result from executeSqlAsync (#24336)
# Why
only return successful `ResultSet` from `executeSqlAsync`
fixes #23884
# How
as commented at https://github.com/expo/expo/issues/23884#issuecomment-1678448739, we should only return successful `ResultSet` from `executeSqlAsync`.
# Test Plan
update test-suite and make sure it passed on both ios and android
show more ...
|
| #
c52e83e3 |
| 28-Jul-2023 |
Kudo Chien <[email protected]> |
[sqlite] fix missing types about transaction from openDatabase (#23751)
# Why
fixes #23667
close ENG-9446
# How
- from #23109, we moved the returned type of `openDatabase()` from `WebSQLDa
[sqlite] fix missing types about transaction from openDatabase (#23751)
# Why
fixes #23667
close ENG-9446
# How
- from #23109, we moved the returned type of `openDatabase()` from `WebSQLDatabase` to `SQLiteDatabase`. however some properties from websql like the `transaction` and `readTransaction` are missing from `SQLiteDatabase`. this pr tries to add those missing properties.
- migrates **test-suite/tests/SQLite** to typescript based which to dogfood our typings
- update generated doc
# Test Plan
- test test-suite SQLite from ios bare-expo
- run `yarn tsc` from **apps/test-suite**
show more ...
|
| #
4a7bfa1d |
| 27-Jun-2023 |
Kudo Chien <[email protected]> |
[sqlite] add experimental promise support (#23109)
# Why
fixes #13357
close ENG-8685
# How
- originally, the callbacks for websql doesn't support Promise. when people using either 'async/a
[sqlite] add experimental promise support (#23109)
# Why
fixes #13357
close ENG-8685
# How
- originally, the callbacks for websql doesn't support Promise. when people using either 'async/async` or '.then` inside the callback, the statement will be executed after the "transaction end" statement.
- we should we low level control without websql at all.
- introduce low-level `execAsync`
- introduce `transactionAsync`
usage
```tsx
const db = SQLite.openDatabase('dbName', version);
const readOnly = true;
await db.transactionAsync(async tx => {
const result = await tx.executeSqlAsync('SELECT COUNT(*) FROM USERS', []);
console.log('Count:', result.rows[0]['COUNT(*)']);
}, readOnly);
```
note that the result is the [`ResultSet` type](https://github.com/expo/expo/blob/065419647694cf9341261bc7ac614d05e4bac27d/packages/expo-sqlite/src/SQLite.types.ts#L167-L177) but not the [`SQLResultSet` type](https://github.com/expo/expo/blob/065419647694cf9341261bc7ac614d05e4bac27d/packages/expo-sqlite/src/SQLite.types.ts#L93C18-L121). people can access the result items by `rows[0]` rather than `rows.item(0)`. i was thinking to deprecate websql somehow and it doesn't make sense to wrap the result by the [`WebSQLResultSet` again](https://github.com/nolanlawson/node-websql/blob/b3e48284572108feff1cd019dc7f13c1d8aa34b2/lib/websql/WebSQLTransaction.js#L12-L36)
# Test Plan
add some SQLite Async unit tests and test suite ci should be passed
show more ...
|
| #
92499077 |
| 04-Jul-2022 |
Tyler Sheaffer <[email protected]> |
[#18077] [expo-sqlite] Support nulls in query args (#18078)
|
| #
3f4e5fe5 |
| 11-Apr-2022 |
Kudo Chien <[email protected]> |
[sqlite] Add `closeAsync` and `deleteAsync` method (#16831)
# Why
requested from AWS Amplify to add Expo integration for the `@aws-amplify/datastore` package.
# How
- exposing `closeAsync`
[sqlite] Add `closeAsync` and `deleteAsync` method (#16831)
# Why
requested from AWS Amplify to add Expo integration for the `@aws-amplify/datastore` package.
# How
- exposing `closeAsync` method publicly
- add `deleteAsync` method
# Test Plan
test-suite SQLite
- added a `should delete db on filesystem from the `deleteAsync()` call` test case
Co-authored-by: Bartłomiej Bukowski <[email protected]>
show more ...
|
| #
abded2bb |
| 13-Aug-2021 |
Bartosz Kaszubowski <[email protected]> |
[sqlite] add doc comments in source, update types (#13976)
* [sqlite] add doc comments in source, update types
* correct two types, support unions of array values + test
* remove debug log
[sqlite] add doc comments in source, update types (#13976)
* [sqlite] add doc comments in source, update types
* correct two types, support unions of array values + test
* remove debug log
* Update packages/expo-sqlite/src/SQLite.ts
Co-authored-by: Tomasz Sapeta <[email protected]>
* regenerate data after review
* Update docs/components/plugins/api/APISectionInterfaces.tsx
Co-authored-by: Bartłomiej Bukowski <[email protected]>
* update map file
* fix lint after review updates
Co-authored-by: Tomasz Sapeta <[email protected]>
Co-authored-by: Bartłomiej Bukowski <[email protected]>
show more ...
|
| #
1fb1afb4 |
| 29-Jul-2021 |
Bartłomiej Bukowski <[email protected]> |
[sqlite] Added missing _array typing to ResultSet return object (#13826)
|
| #
e11b7986 |
| 29-May-2020 |
Stanisław Chmiela <[email protected]> |
[expo-sqlite] Fix Web support (#8518)
# Why
I wanted to clear the way for https://github.com/expo/expo/pull/8242 to be landed (or not). I noticed that web support doesn't look like it should work
[expo-sqlite] Fix Web support (#8518)
# Why
I wanted to clear the way for https://github.com/expo/expo/pull/8242 to be landed (or not). I noticed that web support doesn't look like it should work and that it isn't tested anywhere.
# How
- added SQLite test suite to set run on web
- changed the way we fetch values in test suite from using `._array[0]` to `.item(0)`
- added explanations in `SQLite.types.ts` about why we may need a copy of `@types/websql`
- added `Window` declaration to types declarations
- removed `@types/websql` dependency as it's not even importable
- fixed web counterpart — `SQLite.web.ts` — by fixing the method header and gracefully handling situation where `openDatabase` is not available (I think).
# Test Plan
Test suite passes.
show more ...
|
| #
5ab2946b |
| 24-Jan-2020 |
Will Schurman <[email protected]> |
[eslint-config-universe] Add more lint rules for TypeScript (#6847)
* [eslint-config-universe] Add more lint rules for TypeScript
* expotools check-packages --no-build --no-test --fix-lint
* e
[eslint-config-universe] Add more lint rules for TypeScript (#6847)
* [eslint-config-universe] Add more lint rules for TypeScript
* expotools check-packages --no-build --no-test --fix-lint
* expotools check-packages
show more ...
|
| #
034d2790 |
| 09-Sep-2019 |
Szymon20000 <[email protected]> |
[sqlite] Improve exported types in expo-sqlite module. (#5544)
# Why
Resolves #5264
# How
Copy several types from @types/websql.
|