Skip to content

Commit 6b1f2fa

Browse files
committed
Revert changes to demo.
1 parent 3edca89 commit 6b1f2fa

File tree

6 files changed

+10
-33
lines changed

6 files changed

+10
-33
lines changed

demos/.DS_Store

-6 KB
Binary file not shown.

demos/react-native-supabase-todolist/app/signin.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@ export default function Signin() {
1313
const [credentials, setCredentials] = React.useState({ username: '', password: '' });
1414
const [error, setError] = React.useState('');
1515

16-
// Defensive check for HMR
17-
React.useEffect(() => {
18-
supabaseConnector.client.auth
19-
.getSession()
20-
.then(({ data }) => {
21-
if (data.session) {
22-
router.replace('views/todos/lists');
23-
}
24-
})
25-
26-
}, []);
2716
return (
2817
<View style={{ flexGrow: 1, alignContent: 'center', justifyContent: 'center' }}>
2918
{loading ? (

demos/react-native-supabase-todolist/library/powersync/system.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import '@azure/core-asynciterator-polyfill';
22

3-
import { createBaseLogger, LogLevel, PowerSyncDatabase } from '@powersync/react-native';
3+
import { createBaseLogger, LogLevel, PowerSyncDatabase, SyncClientImplementation } from '@powersync/react-native';
44
import React from 'react';
55
import { SupabaseStorageAdapter } from '../storage/SupabaseStorageAdapter';
66

77
import { type AttachmentRecord } from '@powersync/attachments';
8-
import { SQLJSOpenFactory } from '@powersync/dev-adapter';
98
import { configureFts } from '../fts/fts_setup';
109
import { KVStorage } from '../storage/KVStorage';
1110
import { AppConfig } from '../supabase/AppConfig';
@@ -30,17 +29,9 @@ export class System {
3029
this.storage = this.supabaseConnector.storage;
3130
this.powersync = new PowerSyncDatabase({
3231
schema: AppSchema,
33-
// database: {
34-
// dbFilename: 'ddd'
35-
// },
36-
database: new SQLJSOpenFactory({
37-
dbFilename: 'powersync.db',
38-
persister: {
39-
// TODO
40-
readFile: async () => null,
41-
writeFile: async () => {}
42-
}
43-
}),
32+
database: {
33+
dbFilename: 'sqlite.db'
34+
},
4435
logger
4536
});
4637
/**
@@ -77,7 +68,7 @@ export class System {
7768

7869
async init() {
7970
await this.powersync.init();
80-
await this.powersync.connect(this.supabaseConnector);
71+
await this.powersync.connect(this.supabaseConnector, { clientImplementation: SyncClientImplementation.RUST });
8172

8273
if (this.attachmentQueue) {
8374
await this.attachmentQueue.init();

demos/react-native-supabase-todolist/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"@powersync/attachments": "workspace:*",
1515
"@powersync/common": "workspace:*",
1616
"@powersync/react": "workspace:*",
17-
"@powersync/dev-adapter": "workspace:*",
1817
"@powersync/react-native": "workspace:*",
1918
"@react-native-community/masked-view": "^0.1.11",
2019
"@react-navigation/drawer": "^7.1.1",

packages/dev-adapter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A development DB Adapter for PowerSync which uses [SQL.js](https://sql.js.org/#/
44

55
## Usage
66

7-
By default the SQLJS adapter will be in-memory. Read further for persistor examples.
7+
By default the SQLJS adapter will be in-memory. Read further for persister examples.
88

99
```tsx
1010
import { SQLJSOpenFactory } from '@powersync/dev-adapter';

pnpm-lock.yaml

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)