@kazion/drizzle-utils
v1.0.0
Published
A collection of utilities for working with Drizzle ORM
Downloads
4
Maintainers
Readme
@kazion/drizzle-utils
This is a React package that provides a simple way to add Facebook login to your React application.
Installation
To install this package, run the following command in your terminal:
pnpm install @kazion/drizzle-utils
Usage
To use this package in your application, follow the steps below:
Drizzle or
Filter Query
import { drizzleOrFilterQuery } from "@kazion/drizzle-utils";
// using the query builder
const [staff] = await db
.update(staffs)
.set(payload)
.where(drizzleOrFilterQuery(staffs, { id }))
.returning();
// using the query api
return db.query.staffs.findMany({
where: drizzleOrFilterQuery(staffs, where),
});
Drizzle and
Filter Query
import { drizzleAndFilterQuery } from "@kazion/drizzle-utils";
// using the query builder
const [staff] = await db
.update(staffs)
.set(payload)
.where(drizzleAndFilterQuery(staffs, { id }))
.returning();
// using the query api
return db.query.staffs.findMany({
where: drizzleAndFilterQuery(staffs, where),
});
Testing
To run the tests for this package, use the following command:
pnpm test
Contributing
If you want to contribute to this project, please follow the steps below:
- Fork this repository.
- Create a new branch:
git checkout -b your-branch-name
. - Make your changes and commit them:
git commit -m 'your message'
. - Push to the original branch:
git push origin your-branch-name
. - Create a pull request.
License
This project is licensed under the MIT license.