![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
drizzle-condition
Advanced tools
An alternative, intuitive way to declare drizzle SQL conditions
Simple utilities to define a drizzle-orm condition, without having to import the individual comparator functions. Instead use a single function with logical comparison operators to define the condition.
[!Warning] This library is a work in progress, and is not yet ready for production use.
Install the package from npm:
npm install drizzle-condition
import { integer, sqliteTable } from "drizzle-orm/sqlite-core";
import { condition } from "drizzle-condition";
const myTable = sqliteTable("my_table", {
id: integer("id"),
});
const myQuery = await myDatabaseConnection.query.myTable.findMany({
// where: eq(myTable.id, 1), <-- drizzle-orm implementation eq, gt, lt, etc
where: condition(myTable.id, "==", 1),// <-- drizzle-condition implementation '==', '!=', '>', '<', '>=', '<=' etc
});
I enjoy using the mathmatical operator syntax when building queries, much like firebase and other ORMs, and found myself writing helpers in all my projects to write the queries in this format.
Hopefully this library will make it easier for you to write queries this way too.
drizzle-orm | drizzle-condition |
---|---|
eq | condition(table.column, "==", value) |
ne | ⏱️ todo |
gt | ⏱️ todo |
lt | ⏱️ todo |
gte | ⏱️ todo |
lte | ⏱️ todo |
in | ⏱️ todo |
isNull | ⏱️ todo |
isNotNull | ⏱️ todo |
inArray | ⏱️ todo |
notInArray | ⏱️ todo |
exists | ⏱️ todo |
notExists | ⏱️ todo |
between | ⏱️ todo |
notBetween | ⏱️ todo |
like | ⏱️ todo |
notLike | ⏱️ todo |
ilike | ⏱️ todo |
notIlike | ⏱️ todo |
not | ⏱️ todo |
and | ⏱️ todo |
or | ⏱️ todo |
arrayContains | ⏱️ todo |
arrayContainedIn | ⏱️ todo |
arrayOverlaps | ⏱️ todo |
Contributions are welcome!
Package manager: bun Test runner: vitest Linter: biome
bun install
bun run all
package.json
for more details.Create a pull request to the main
branch from your forked repository.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
An alternative, intuitive way to declare drizzle SQL conditions
The npm package drizzle-condition receives a total of 0 weekly downloads. As such, drizzle-condition popularity was classified as not popular.
We found that drizzle-condition demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.