Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix enum and release 5.11.0 #20

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tidbcloud/prisma-adapter",
"version": "5.10.2",
"version": "5.11.0",
"description": "Prisma's driver adapter for \"@tidbcloud/serverless\"",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down Expand Up @@ -34,7 +34,7 @@
"license": "Apache-2.0",
"sideEffects": false,
"dependencies": {
"@prisma/driver-adapter-utils": "5.10.2"
"@prisma/driver-adapter-utils": "5.11.0"
},
"devDependencies": {
"@tidbcloud/serverless": "^0.1.0",
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export type TiDBCloudColumnType =
| "DATETIME"
| "TIMESTAMP"
| "JSON"
| "BIT";
| "BIT"
| "SET"
| "ENUM";

/**
* This is a simplification of quaint's value inference logic. Take a look at quaint's conversion.rs
Expand Down Expand Up @@ -85,6 +87,10 @@ export function fieldToColumnType(field: TiDBCloudColumnType): ColumnType {
case "VARBINARY":
case "BIT":
return ColumnTypeEnum.Bytes;
case "SET":
return ColumnTypeEnum.Set;
case "ENUM":
return ColumnTypeEnum.Enum;
case "NULL":
// Fall back to Int32 for consistency with quaint.
return ColumnTypeEnum.Int32;
Expand Down
Loading