| #
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 ...
|
| #
9b26454e |
| 08-Dec-2022 |
Bartosz Kaszubowski <[email protected]> |
[workspace] bump and align TypeScript version (#20392)
|
| #
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 ...
|
| #
00ec8cab |
| 04-Jan-2022 |
Evan Bacon <[email protected]> |
Use declaration maps (#15782)
* Added declarationMap to base tsconfig
* et cp -a --no-lint --no-test --no-uniformity-check
|