https://github.com/marshallswain/feathers-kysely
https://github.com/marshallswain/feathers-kysely
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marshallswain/feathers-kysely
- Owner: marshallswain
- License: mit
- Created: 2023-05-30T04:25:08.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-02T03:07:04.000Z (about 1 year ago)
- Last Synced: 2025-02-16T03:48:41.495Z (4 months ago)
- Language: TypeScript
- Size: 274 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# feathers-kysely
[](https://www.npmjs.com/package/feathers-kysely)
[](https://discord.gg/qa8kez8QBx)> Feathers SQL service adapter built with Kysely
## Installation
```bash
npm install feathers-kysely --save
```## Documentation
Official docs are pending. You can learn a lot from the tests, though:
- [Connect to a Database](https://github.com/marshallswain/feathers-kysely/blob/master/test/index.test.ts#L91-L115)
- [Create Tables](https://github.com/marshallswain/feathers-kysely/blob/master/test/index.test.ts#L120-L162)
- [Create Kysely Services](https://github.com/marshallswain/feathers-kysely/blob/master/test/index.test.ts#L226-L252)
- [Register Services](https://github.com/marshallswain/feathers-kysely/blob/master/test/index.test.ts#L268-L277)## Note about custom queries
Like all Feathers services, you can access the underlying database adapter at `service.Model`. One thing worth noting in `feathers-kysely` is that `service.Model` is the full Kysely instance and not locked down to the current table. So you have to provide the table name in each of the methods that you use, like
- `service.Model.selectFrom('my-table')...`
- `service.Model.insertInto('my-table')...`
- `service.Model.updateTable('my-table')...`## No Transactions-Specific Methods
Note that I haven't created any Feathers-specific tooling around doing transactions, yet, but you should be able to follow the [Kysely documentation on transactions](https://kysely-org.github.io/kysely/classes/Transaction.html#transaction) and put Feathers-Kysely service calls inside the execute block.
## License
Copyright (c) 2023 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
Licensed under the [MIT license](LICENSE).