Skip to content

Commit

Permalink
Merge pull request #126 from powersync-ja/update-attachments-desc
Browse files Browse the repository at this point in the history
Update description
  • Loading branch information
benitav authored Apr 17, 2024
2 parents 3f6d577 + bc9eca5 commit cb687f0
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ _Bad connectivity is everywhere, and we're tired of it. PowerSync is on a missio

- [packages/powersync-attachments](./packages/powersync-attachments/README.md)

- Attachments helper package for React Native.
- Attachments helper package for React Native and JavaScript/TypeScript projects.

- [packages/kysely-driver](./packages/kysely-driver/README.md)

- Kysely integration (ORM) for React Native and JS Web.
- Kysely integration (ORM) for React Native and JavaScript/TypeScript projects.

- [packages/powersync-sdk-common](./packages/powersync-sdk-common/README.md)
- Shared package: TypeScript implementation of a PowerSync database connector and streaming sync bucket implementation.
Expand Down
6 changes: 3 additions & 3 deletions demos/example-nextjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example is built using [Next.js](https://nextjs.org/) and the [PowerSync JS

To see it in action:

1. Make sure to run `pnpm build:packages` in the root directory of this Git repo.
1. Make sure to run `pnpm install` and `pnpm build:packages` in the root directory of this repo.
2. Copy `.env.local.template` to `.env.local`, and complete the environment variables. You can generate a [temporary development token](https://docs.powersync.com/usage/installation/authentication-setup/development-tokens), or leave blank to test with local-only data.
3. `pnpm start`
4. Open the localhost URL in the browser displayed in the terminal output.
3. cd into this directory and run `pnpm start`.
4. Open the localhost URL displayed in the terminal output in your browser.
8 changes: 5 additions & 3 deletions demos/example-vite/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# PowerSync Vite bundling test

This is a minimal example demonstrating bundling with Vite. It attempts a connection to verify that web workers load correctly, but networks requests will fail since no credentials are configured. See [src/index.js](src/index.js) for details.

To see it in action:

1. Make sure to run `pnpm build:packages` in the root directory of this Git repo.
2. `pnpm start`
3. Open the localhost URL in the browser displayed in the terminal output.
1. Make sure to run `pnpm install` and `pnpm build:packages` in the root directory of this repo.
2. cd into this directory, and run `pnpm start`.
3. Open the localhost URL displayed in the terminal output in your browser.
7 changes: 1 addition & 6 deletions demos/example-vite/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ let PowerSync;
const openDatabase = async () => {
PowerSync = new WASQLitePowerSyncDatabaseOpenFactory({
schema: AppSchema,
dbFilename: 'test.sqlite',
flags: {
// This is disabled once CSR+SSR functionality is verified to be working correctly
disableSSRWarning: true
}
dbFilename: 'test.sqlite'
}).getInstance();

await PowerSync.init();
Expand All @@ -61,6 +57,5 @@ const openDatabase = async () => {
};

document.addEventListener('DOMContentLoaded', (event) => {
console.log('hello');
openDatabase();
});
8 changes: 5 additions & 3 deletions demos/example-webpack/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# PowerSync Webpack bundling test

This is a minimal example demonstrating bundling with Webpack. It attempts a connection to verify that web workers load correctly, but networks requests will fail since no credentials are configured. See [src/index.js](src/index.js) for details.

To see it in action:

1. Make sure to run `pnpm build:packages` in the root directory of this Git repo.
2. `pnpm start`
3. Open the localhost URL in the browser displayed in the terminal output.
1. Make sure to run `pnpm install` and `pnpm build:packages` in the root directory of this repo.
2. cd into this directory, and run `pnpm start`.
3. Open the localhost URL displayed in the terminal output in your browser.
31 changes: 30 additions & 1 deletion demos/example-webpack/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ import {
Table
} from '@journeyapps/powersync-sdk-web';

/**
* A placeholder connector which doesn't do anything.
* This is just used to verify that the sync workers can be loaded
* when connecting.
*/
class DummyConnector {
async fetchCredentials() {
return {
endpoint: '',
token: ''
};
}

async uploadData(database) {}
}

export const AppSchema = new Schema([
new Table({ name: 'customers', columns: [new Column({ name: 'name', type: ColumnType.TEXT })] })
]);
Expand All @@ -25,8 +41,21 @@ const openDatabase = async () => {

const result = await PowerSync.getAll('SELECT * FROM customers');
console.log('contents of customers: ', result);

console.log(
`Attempting to connect in order to verify web workers are correctly loaded.
This doesn't use any actual network credentials.
Network errors will be shown: these can be ignored.`
);

/**
* Try and connect, this will setup shared sync workers
* This will fail due to not having a valid endpoint,
* but it will try - which is all that matters.
*/
await PowerSync.connect(new DummyConnector());
};

document.addEventListener('DOMContentLoaded', (event) => {
openDatabase();
});
});
2 changes: 1 addition & 1 deletion packages/powersync-attachments/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @journeyapps/powersync-attachments

A [PowerSync](https://powersync.co) library to manage attachments in TypeScript and React Native apps.
A [PowerSync](https://powersync.com) library to manage attachments in React Native and JavaScript/TypeScript apps.

## Installation

Expand Down

0 comments on commit cb687f0

Please sign in to comment.