Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions client-sdks/reference/capacitor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const db = new PowerSyncDatabase({
});
```

Once you've instantiated your PowerSync database, call the [connect()](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#connect) method to sync data with your backend.
Once you've instantiated your PowerSync database, call the [connect()](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#connect) method to sync data with your backend.

<LocalOnly />

Expand Down Expand Up @@ -234,7 +234,7 @@ The most commonly used CRUD functions to interact with your SQLite data are:

### Fetching a Single Item

The [get](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#get) method executes a read-only (SELECT) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#getoptional) to return a single optional result (returns `null` if no result is found).
The [get](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#get) method executes a read-only (SELECT) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#getoptional) to return a single optional result (returns `null` if no result is found).

```js
// Find a list item by ID
Expand All @@ -246,7 +246,7 @@ export const findList = async (id) => {

### Querying Items (PowerSync.getAll)

The [getAll](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#getall) method returns a set of rows from a table.
The [getAll](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#getall) method returns a set of rows from a table.

```js
// Get all list IDs
Expand All @@ -258,7 +258,7 @@ export const getLists = async () => {

### Watching Queries (PowerSync.watch)

The [watch](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#watch) method executes a read query whenever a change to a dependent table is made.
The [watch](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#watch) method executes a read query whenever a change to a dependent table is made.

<Tabs>
<Tab title="AsyncIterator approach">
Expand All @@ -273,7 +273,7 @@ For advanced watch query features like incremental updates and differential resu

### Mutations (PowerSync.execute, PowerSync.writeTransaction)

The [execute](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#execute) method can be used for executing single SQLite write statements.
The [execute](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#execute) method can be used for executing single SQLite write statements.

```js
// Delete a list item by ID
Expand Down
18 changes: 6 additions & 12 deletions client-sdks/reference/javascript-web.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,7 @@ export const db = new PowerSyncDatabase({
});
```

<Note>
**SDK versions lower than 1.2.0**

In SDK versions lower than 1.2.0, you will need to use the deprecated [WASQLitePowerSyncDatabaseOpenFactory](https://powersync-ja.github.io/powersync-js/web-sdk/classes/WASQLitePowerSyncDatabaseOpenFactory) syntax to instantiate the database.
</Note>

Once you've instantiated your PowerSync database, call the [connect()](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#connect) method to sync data with your backend.
Once you've instantiated your PowerSync database, call the [connect()](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#connect) method to sync data with your backend.

<LocalOnly />

Expand Down Expand Up @@ -231,7 +225,7 @@ The most commonly used CRUD functions to interact with your SQLite data are:

### Fetching a Single Item

The [get](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#get) method executes a read-only (SELECT) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#getoptional) to return a single optional result (returns `null` if no result is found).
The [get](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#get) method executes a read-only (SELECT) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#getoptional) to return a single optional result (returns `null` if no result is found).

```js
// Find a list item by ID
Expand All @@ -243,7 +237,7 @@ export const findList = async (id) => {

### Querying Items (PowerSync.getAll)

The [getAll](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#getall) method returns a set of rows from a table.
The [getAll](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#getall) method returns a set of rows from a table.

```js
// Get all list IDs
Expand All @@ -255,7 +249,7 @@ export const getLists = async () => {

### Watching Queries (PowerSync.watch)

The [watch](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#watch) method executes a read query whenever a change to a dependent table is made.
The [watch](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#watch) method executes a read query whenever a change to a dependent table is made.

<Tabs>
<Tab title="AsyncIterator approach">
Expand All @@ -270,7 +264,7 @@ For advanced watch query features like incremental updates and differential resu

### Mutations (PowerSync.execute, PowerSync.writeTransaction)

The [execute](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#execute) method can be used for executing single SQLite write statements.
The [execute](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#execute) method can be used for executing single SQLite write statements.

```js
// Delete a list item by ID
Expand Down Expand Up @@ -320,7 +314,7 @@ const logger = createConsoleLogger({ minLevel: LogLevels.trace });
```
</Tip>

Additionally, the [WASQLiteDBAdapter](https://powersync-ja.github.io/powersync-js/web-sdk/classes/WASQLiteDBAdapter) opens SQLite connections inside a shared web worker. This worker can be inspected in Chrome by accessing:
Additionally, the [WASQLiteOpenFactory](https://powersync-ja.github.io/powersync-js/web-sdk/classes/WASQLiteOpenFactory) opens SQLite connections inside a shared web worker. This worker can be inspected in Chrome by accessing:

```
chrome://inspect/#workers
Expand Down
12 changes: 6 additions & 6 deletions client-sdks/reference/react-native-and-expo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const powersync = new PowerSyncDatabase({
});
```

Once you've instantiated your PowerSync database, call the [connect()](https://powersync-ja.github.io/powersync-js/react-native-sdk/classes/PowerSyncDatabase#connect) method to sync data with your backend.
Once you've instantiated your PowerSync database, call the [connect()](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#connect) method to sync data with your backend.

<LocalOnly />

Expand Down Expand Up @@ -182,7 +182,7 @@ export class Connector implements PowerSyncBackendConnector {

/**
* For batched crud transactions, use data.getCrudBatch(n);
* https://powersync-ja.github.io/powersync-js/react-native-sdk/classes/SqliteBucketStorage#getcrudbatch
* https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#getcrudbatch
*/
const transaction = await database.getNextCrudTransaction();

Expand Down Expand Up @@ -225,7 +225,7 @@ The most commonly used CRUD functions to interact with your SQLite data are:

### Fetching a Single Item

The [get](https://powersync-ja.github.io/powersync-js/react-native-sdk/classes/PowerSyncDatabase#get) method executes a read-only (`SELECT`) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://powersync-ja.github.io/powersync-js/react-native-sdk/classes/PowerSyncDatabase#getoptional) to return a single optional result (returns `null` if no result is found).
The [get](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#get) method executes a read-only (`SELECT`) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#getoptional) to return a single optional result (returns `null` if no result is found).


```js TodoItemWidget.jsx
Expand All @@ -249,7 +249,7 @@ export const TodoItemWidget = ({id}) => {

### Querying Items (`PowerSync.getAll`)

The [getAll](https://powersync-ja.github.io/powersync-js/react-native-sdk/classes/PowerSyncDatabase#getall) method returns a set of rows from a table.
The [getAll](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#getall) method returns a set of rows from a table.

```js ListsWidget.jsx
import { FlatList, Text} from 'react-native';
Expand All @@ -271,7 +271,7 @@ export const ListsWidget = () => {

### Watching Queries (`PowerSync.watch`)

The [watch](https://powersync-ja.github.io/powersync-js/react-native-sdk/classes/PowerSyncDatabase#watch) method executes a read query whenever a change to a dependent table is made. It can be used with an `AsyncGenerator`, or with a callback.
The [watch](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#watch) method executes a read query whenever a change to a dependent table is made. It can be used with an `AsyncGenerator`, or with a callback.

<Tabs>
<Tab title="AsyncIterator approach">
Expand All @@ -286,7 +286,7 @@ For advanced watch query features like incremental updates and differential resu

### Mutations (`PowerSync.execute`)

The [execute](https://powersync-ja.github.io/powersync-js/react-native-sdk/classes/PowerSyncDatabase#execute) method can be used for executing single SQLite write statements.
The [execute](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#execute) method can be used for executing single SQLite write statements.

```js ListsWidget.jsx
import { Alert, Button, FlatList, Text, View } from 'react-native';
Expand Down
8 changes: 4 additions & 4 deletions client-sdks/reference/tauri.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ The most commonly used CRUD functions to interact with your SQLite data are:

### Fetching a Single Item

The [get](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#get) method executes a read-only (SELECT) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#getoptional) to return a single optional result (returns `null` if no result is found).
The [get](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#get) method executes a read-only (SELECT) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#getoptional) to return a single optional result (returns `null` if no result is found).

```js
// Find a list item by ID
Expand All @@ -256,7 +256,7 @@ export const findList = async (id) => {

### Querying Items (PowerSync.getAll)

The [getAll](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#getall) method returns a set of rows from a table.
The [getAll](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#getall) method returns a set of rows from a table.

```js
// Get all list IDs
Expand All @@ -268,7 +268,7 @@ export const getLists = async () => {

### Watching Queries (PowerSync.watch)

The [watch](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#watch) method executes a read query whenever a change to a dependent table is made.
The [watch](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#watch) method executes a read query whenever a change to a dependent table is made.

<Tabs>
<Tab title="AsyncIterator approach">
Expand All @@ -283,7 +283,7 @@ For advanced watch query features like incremental updates and differential resu

### Mutations (PowerSync.execute, PowerSync.writeTransaction)

The [execute](https://powersync-ja.github.io/powersync-js/web-sdk/classes/PowerSyncDatabase#execute) method can be used for executing single SQLite write statements.
The [execute](https://powersync-ja.github.io/powersync-js/common/interfaces/CommonPowerSyncDatabase#execute) method can be used for executing single SQLite write statements.

```js
// Delete a list item by ID
Expand Down
Loading