0.8.0 • Published 2 years ago

@bonsai-thing/data v0.8.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
2 years ago

Run the tests:

npm run test
npm run test:watch

Build

You can get this whole package built for publishing by running:

npm run build

That command however runs three subcommands:

  • build:generate — generates the resolver types from graphql.schema that end up in src/__generated__
  • build:types — compiles the TypeScript and emits declaration files in dist/
  • build:vite — compiles all of the TypeScript down into JavaScript files in dist/

Formatting, Linting, Type Checking

There are a variety of commands for checking things are OK:

npm run check:types
npm run check:lint

... and for fixing issues:

npm run fix:format
npm run fix:lint

Publish a new version

npm run build
npx bump-n-pub minor

This temporarily strips the dev dependencies out of the package.json so this package is a little lighter to install.

Running tests against the cloud database

TEST_DB=cloud yarn test

Connecting to the cloud database

Here's an example of how you would list the permissions on various tables:

brew cask install mysql-shell
mysqlsh mysql://[admin user name]@canvalog-mysql.mysql.database.azure.com:3306

After entering the admin password you can enter stuff in the Mysql shell:

shell.options.set('resultFormat','vertical')
\sql SELECT * from mysql.db;

Running tests against the cloud database

AZURE_MYSQL_USER=test_user AZURE_MYSQL_PASSWORD=[test user password] TEST_DB=cloud yarn test

Future

  • Factor out db abstraction into mysqlite lib