Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensJourney committed Oct 30, 2023
1 parent ab9957b commit 85f6c00
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .changeset/chilled-walls-promise.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
---

Updated logic to correspond with React Native Quick SQLite concurrent transactions. Added helper methods on transaction contexts.

API changes include:
- Removal of synchronous DB operations in transactions: `execute`, `commit`, `rollback` are now async functions. `executeAsync`, `commitAsync` and `rollbackAsync` have been removed.
2 changes: 1 addition & 1 deletion apps/supabase-todolist
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ export abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncDB
);
}

async *watch(sql: string, parameters: any[], options?: SQLWatchOptions): AsyncIterable<QueryResult> {
async *watch(sql: string, parameters?: any[], options?: SQLWatchOptions): AsyncIterable<QueryResult> {
//Fetch initial data
yield await this.execute(sql, parameters);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,14 @@ export abstract class AbstractStreamingSyncImplementation extends BaseObserver<S
}

async *streamingSyncRequest(req: StreamingSyncRequest, signal: AbortSignal): AsyncGenerator<StreamingSyncLine> {
console.log('sending request');
const body = await this.options.remote.postStreaming('/sync/stream', req, {}, signal);
console.log('[streamingSyncRequest]', body);
const stream = ndjsonStream(body);
const reader = stream.getReader();

try {
while (true) {
// Read from the stream
const { done, value } = await reader.read();
console.log('value', value);
// Exit if we're done
if (done) return;
// Else yield the chunk
Expand Down
4 changes: 2 additions & 2 deletions packages/powersync-sdk-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"homepage": "https://docs.powersync.co/",
"peerDependencies": {
"@journeyapps/react-native-quick-sqlite": "0.0.0-dev-20231026145554",
"@journeyapps/react-native-quick-sqlite": "0.0.0-dev-20231030064733",
"base-64": "^1.0.0",
"react": "*",
"react-native-fetch-api": "^3.0.0",
Expand All @@ -40,7 +40,7 @@
"async-lock": "^1.4.0"
},
"devDependencies": {
"@journeyapps/react-native-quick-sqlite": "0.0.0-dev-20231026145554",
"@journeyapps/react-native-quick-sqlite": "0.0.0-dev-20231030064733",
"@types/async-lock": "^1.4.0",
"react": "18.2.0",
"typescript": "^4.1.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export class ReactNativeRemote extends AbstractRemote {
throw error;
}

console.log(res.body);
return res.body;
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2134,10 +2134,10 @@
"@types/yargs" "^17.0.8"
chalk "^4.0.0"

"@journeyapps/[email protected]20231026145554":
version "0.0.0-dev-20231026145554"
resolved "https://registry.npmjs.org/@journeyapps/react-native-quick-sqlite/-/react-native-quick-sqlite-0.0.0-dev-20231026145554.tgz#bb2169f270d58b03fd7a8e3a81a956563010e45a"
integrity sha512-0JCfOsgfynOKCPoP7YijpGamBBG0AQi/3Ai01WV6mbJylGGHCPeWo3ErM0x02eL5sIiy64ZIFUsTNhxt/Z5dIg==
"@journeyapps/[email protected]20231030064733":
version "0.0.0-dev-20231030064733"
resolved "https://registry.npmjs.org/@journeyapps/react-native-quick-sqlite/-/react-native-quick-sqlite-0.0.0-dev-20231030064733.tgz#33008ee214a52726d4e4429af7e196bbea2e4293"
integrity sha512-IR7fWhMY/SRAdBINie67OncupRSluIAH2LyR3YEOMJGbXvVbPtDGieT1fXIiUZ2VFbhbIhXOTusgZ4RADmbFiQ==
dependencies:
lodash "^4.17.21"

Expand Down

0 comments on commit 85f6c00

Please sign in to comment.