From 55dfb8e568520c1cd174c0057af57ec7b60d943e Mon Sep 17 00:00:00 2001 From: prodrigues Date: Tue, 13 Aug 2024 15:20:43 +0100 Subject: [PATCH] lint fix --- drizzle-orm/type-tests/singlestore/generated-columns.ts | 2 +- drizzle-orm/type-tests/singlestore/select.ts | 2 +- drizzle-orm/type-tests/singlestore/subquery.ts | 2 +- drizzle-orm/type-tests/singlestore/tables.ts | 2 +- drizzle-orm/type-tests/singlestore/with.ts | 2 +- drizzle-typebox/src/index.ts | 2 +- drizzle-typebox/tests/singlestore.test.ts | 1 - drizzle-valibot/tests/singlestore.test.ts | 6 +++--- drizzle-zod/src/index.ts | 3 +-- drizzle-zod/tests/singlestore.test.ts | 6 +++--- 10 files changed, 13 insertions(+), 15 deletions(-) diff --git a/drizzle-orm/type-tests/singlestore/generated-columns.ts b/drizzle-orm/type-tests/singlestore/generated-columns.ts index 1f3c501a4..e31ab050a 100644 --- a/drizzle-orm/type-tests/singlestore/generated-columns.ts +++ b/drizzle-orm/type-tests/singlestore/generated-columns.ts @@ -1,7 +1,7 @@ import { type Equal, Expect } from 'type-tests/utils'; import { type InferInsertModel, type InferSelectModel, sql } from '~/index'; -import { singlestoreTable, serial, text, varchar } from '~/singlestore-core'; import { drizzle } from '~/mysql2'; +import { serial, singlestoreTable, text, varchar } from '~/singlestore-core'; import { db } from './db'; const users = singlestoreTable( diff --git a/drizzle-orm/type-tests/singlestore/select.ts b/drizzle-orm/type-tests/singlestore/select.ts index 5eb9ccece..10a7551a7 100644 --- a/drizzle-orm/type-tests/singlestore/select.ts +++ b/drizzle-orm/type-tests/singlestore/select.ts @@ -26,7 +26,7 @@ import { param, sql } from '~/sql/sql.ts'; import type { Equal } from 'type-tests/utils.ts'; import { Expect } from 'type-tests/utils.ts'; -import { type SingleStoreSelect, type SingleStoreSelectQueryBuilder, QueryBuilder } from '~/singlestore-core/index.ts'; +import { QueryBuilder, type SingleStoreSelect, type SingleStoreSelectQueryBuilder } from '~/singlestore-core/index.ts'; import { db } from './db.ts'; import { cities, classes, newYorkers, users } from './tables.ts'; diff --git a/drizzle-orm/type-tests/singlestore/subquery.ts b/drizzle-orm/type-tests/singlestore/subquery.ts index 615606240..e8ee4e80b 100644 --- a/drizzle-orm/type-tests/singlestore/subquery.ts +++ b/drizzle-orm/type-tests/singlestore/subquery.ts @@ -1,6 +1,6 @@ import { Expect } from 'type-tests/utils.ts'; import { and, eq } from '~/expressions.ts'; -import { alias, int, singlestoreTable, serial, text } from '~/singlestore-core/index.ts'; +import { alias, int, serial, singlestoreTable, text } from '~/singlestore-core/index.ts'; import { sql } from '~/sql/sql.ts'; import type { DrizzleTypeError, Equal } from '~/utils.ts'; import { db } from './db.ts'; diff --git a/drizzle-orm/type-tests/singlestore/tables.ts b/drizzle-orm/type-tests/singlestore/tables.ts index 2e8117d63..ea80c1db5 100644 --- a/drizzle-orm/type-tests/singlestore/tables.ts +++ b/drizzle-orm/type-tests/singlestore/tables.ts @@ -54,7 +54,7 @@ export const users = singlestoreTable( .lock('default') .algorythm('copy') .using(`btree`), - pk: primaryKey({columns: [users.age1, users.class]}), + pk: primaryKey({ columns: [users.age1, users.class] }), }), ); diff --git a/drizzle-orm/type-tests/singlestore/with.ts b/drizzle-orm/type-tests/singlestore/with.ts index a838acaea..77309e32a 100644 --- a/drizzle-orm/type-tests/singlestore/with.ts +++ b/drizzle-orm/type-tests/singlestore/with.ts @@ -1,7 +1,7 @@ import type { Equal } from 'type-tests/utils.ts'; import { Expect } from 'type-tests/utils.ts'; import { gt, inArray } from '~/expressions.ts'; -import { int, singlestoreTable, serial, text } from '~/singlestore-core/index.ts'; +import { int, serial, singlestoreTable, text } from '~/singlestore-core/index.ts'; import { sql } from '~/sql/sql.ts'; import { db } from './db.ts'; diff --git a/drizzle-typebox/src/index.ts b/drizzle-typebox/src/index.ts index a4a78bbb7..512b979e4 100644 --- a/drizzle-typebox/src/index.ts +++ b/drizzle-typebox/src/index.ts @@ -26,8 +26,8 @@ import { type Table, } from 'drizzle-orm'; import { MySqlChar, MySqlVarBinary, MySqlVarChar } from 'drizzle-orm/mysql-core'; -import { SingleStoreChar, SingleStoreVarBinary, SingleStoreVarChar} from 'drizzle-orm/singlestore-core'; import { type PgArray, PgChar, PgUUID, PgVarchar } from 'drizzle-orm/pg-core'; +import { SingleStoreChar, SingleStoreVarBinary, SingleStoreVarChar } from 'drizzle-orm/singlestore-core'; import { SQLiteText } from 'drizzle-orm/sqlite-core'; type TUnionLiterals = T extends readonly [ diff --git a/drizzle-typebox/tests/singlestore.test.ts b/drizzle-typebox/tests/singlestore.test.ts index c47844b0e..1e790ec41 100644 --- a/drizzle-typebox/tests/singlestore.test.ts +++ b/drizzle-typebox/tests/singlestore.test.ts @@ -36,7 +36,6 @@ import { expect, test } from 'vitest'; import { createInsertSchema, createSelectSchema, jsonSchema } from '../src/index.ts'; import { expectSchemaShape } from './utils.ts'; - const customInt = customType<{ data: number }>({ dataType() { return 'int'; diff --git a/drizzle-valibot/tests/singlestore.test.ts b/drizzle-valibot/tests/singlestore.test.ts index 8af4fe594..8ec563089 100644 --- a/drizzle-valibot/tests/singlestore.test.ts +++ b/drizzle-valibot/tests/singlestore.test.ts @@ -1,3 +1,4 @@ +import { BSON } from 'bson'; import { bigint, binary, @@ -15,10 +16,10 @@ import { longtext, mediumint, mediumtext, - singlestoreEnum, - singlestoreTable, real, serial, + singlestoreEnum, + singlestoreTable, smallint, text, time, @@ -47,7 +48,6 @@ import { import { expect, test } from 'vitest'; import { createInsertSchema, createSelectSchema, jsonSchema } from '../src/index.ts'; import { expectSchemaShape } from './utils.ts'; -import {BSON} from 'bson'; const customInt = customType<{ data: number }>({ dataType() { diff --git a/drizzle-zod/src/index.ts b/drizzle-zod/src/index.ts index 9f219f296..62a592347 100644 --- a/drizzle-zod/src/index.ts +++ b/drizzle-zod/src/index.ts @@ -206,8 +206,7 @@ function mapColumnToSchema(column: Column): z.ZodTypeAny { type = z.any(); } else if (column.dataType === 'buffer') { type = z.any(); - } - else if (column.dataType === 'json') { + } else if (column.dataType === 'json') { type = jsonSchema; } else if (column.dataType === 'array') { type = z.array(mapColumnToSchema((column as PgArray).baseColumn)); diff --git a/drizzle-zod/tests/singlestore.test.ts b/drizzle-zod/tests/singlestore.test.ts index 8626a2281..4613a3db4 100644 --- a/drizzle-zod/tests/singlestore.test.ts +++ b/drizzle-zod/tests/singlestore.test.ts @@ -1,3 +1,4 @@ +import { BSON } from 'bson'; import { bigint, binary, @@ -15,10 +16,10 @@ import { longtext, mediumint, mediumtext, - singlestoreEnum, - singlestoreTable, real, serial, + singlestoreEnum, + singlestoreTable, smallint, text, time, @@ -33,7 +34,6 @@ import { expect, test } from 'vitest'; import { z } from 'zod'; import { createInsertSchema, createSelectSchema, jsonSchema } from '~/index'; import { expectSchemaShape } from './utils.ts'; -import {BSON} from 'bson'; const customInt = customType<{ data: number }>({ dataType() {