| #
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 ...
|
| #
50e16f8c |
| 08-Sep-2023 |
Alan Hughes <[email protected]> |
[android][sqlite] Add support for running raw queries (#24320)
|
| #
74e0b8df |
| 02-Aug-2023 |
Alan Hughes <[email protected]> |
[sqlite] CRSQLite integration (#23791)
# Why
Supercedes #23728
Completes ENG-8809
Investigate possibility of using [crsqlite](https://vlcn.io/) in
`expo-sqlite` which allows database syncing b
[sqlite] CRSQLite integration (#23791)
# Why
Supercedes #23728
Completes ENG-8809
Investigate possibility of using [crsqlite](https://vlcn.io/) in
`expo-sqlite` which allows database syncing between clients.
# How
- Added the crsqlite extension as a framework and provided an event that
contains the changeset to send to the server.
- Currently only works on iOS.
- Needs input on an API
- Discussion about how to handle the sync server
- Need to look into demo using TinyBase. This will require writing a
custom `persister`
# Test Plan
https://github.com/expo/expo/assets/30924086/1b576700-4ff7-4270-9f50-7e0d464b4975
show more ...
|
| #
6c4baee8 |
| 28-Jul-2023 |
Alan Hughes <[email protected]> |
[sqlite] Add synchronous close method (#23757)
|
| #
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 ...
|
| #
a7112dad |
| 28-Mar-2022 |
Bartosz Kaszubowski <[email protected]> |
[docs] detect broken internal links in generated doc comments, fix links (#16771)
Co-authored-by: Tomasz Sapeta <[email protected]>
|
| #
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
|
| #
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 ...
|
| #
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.
|
| #
5daa27a2 |
| 04-Jul-2019 |
Tomasz Sapeta <[email protected]> |
[sqlite] fix typings of SQLiteCallback
|
| #
5cb26b36 |
| 04-Jul-2019 |
Tomo Krajina <[email protected]> |
[sqlite] Export WebSQLDatabase and Query (#4446)
# Why
The current `d.ts` file for SQLIte is:
```typescript
import './polyfillNextTick';
declare type InternalResultSet = {
error: Error;
[sqlite] Export WebSQLDatabase and Query (#4446)
# Why
The current `d.ts` file for SQLIte is:
```typescript
import './polyfillNextTick';
declare type InternalResultSet = {
error: Error;
} | {
insertId?: number;
rowsAffected: number;
rows: Array<{
[column: string]: any;
}>;
};
export declare type SQLiteCallback = (error?: Error | null, resultSet?: InternalResultSet) => void;
export declare function openDatabase(name: string, version?: string, description?: string, size?: number, callback?: (db: WebSQLDatabase) => void): WebSQLDatabase;
declare type WebSQLDatabase = unknown;
declare const _default: {
openDatabase: typeof openDatabase;
};
export default _default;
```
Since `WebSQLDatabase` is `unknown` it forces the user to work with the result of `openDatabase()` as with any other type-unsafe object. Basically erasing any improvement from a typescript declaration file.
Note that even the DefinitelyTyped `.d.ts` has (almost) everything needed to make the API completely typesafe (one thing missing is probably `openDatabase()` returning a `Database` instead of `any`): https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/expo/index.d.ts#L2595
# How
This PR adds a new interface `WebSQLDatabase` with the following method:
```
exec(queries: Query[], readOnly: boolean, callback: SQLiteCallback): void
```
and makes `openDatabase()` return that interface.
In addition to that it also exposes `Query` and `ResultSet`. They are renamed from `InternalQuery` and `InternalResultSet`, since they aren't really "internal" types, but exposed to the user in the APIs.
This PR is just an idea, feedback is welcome.
show more ...
|
| #
2ee87287 |
| 21-Jan-2019 |
Szymon20000 <[email protected]> |
[expo-sqlite] Extract SQLite API into a universal module (#3071)
# Why
Closes https://github.com/expo/expo/issues/3026
# How
Followed https://github.com/expo/expo/blob/master/guides/Creatin
[expo-sqlite] Extract SQLite API into a universal module (#3071)
# Why
Closes https://github.com/expo/expo/issues/3026
# How
Followed https://github.com/expo/expo/blob/master/guides/Creating%20Universal%20Modules.md.
# Test Plan
Ran https://snack.expo.io/BJGgVWSxV in sandbox.
show more ...
|