Skip to content

Commit

Permalink
Add drizzle orm support
Browse files Browse the repository at this point in the history
  • Loading branch information
quolpr committed Jan 15, 2024
1 parent 206b933 commit de56022
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/kikko/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @kikko-land/core

## 0.19.1

### Patch Changes

- 39e9f77: Add srizzle orm support

## 0.19.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/kikko/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kikko-land/kikko",
"version": "0.19.0",
"version": "0.19.1",
"author": "Sergey Popov",
"license": "MIT",
"main": "./src/index.ts",
Expand Down
7 changes: 7 additions & 0 deletions packages/kikko/src/runQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export const sqlToValues = (
return q.preparedQuery;
} else if ("toSql" in q) {
return sqlToValues(q.toSql());
} else if ("toSQL" in q) {
const { sql, params } = q.toSQL();

return {
text: sql,
values: params as IPrimitiveValue[],
};
} else {
const { sql, parameters } = q;

Expand Down
7 changes: 7 additions & 0 deletions packages/kikko/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ export type ISqlToRun =
readonly parameters: ReadonlyArray<unknown>;
};
}
| {
// Drizzle ORM
toSQL: () => {
sql: string;
params: unknown[];
};
}
| ISql
| ISqlAdapter;

Expand Down

0 comments on commit de56022

Please sign in to comment.