You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to build a small app using Effect and drizzle but I keep getting build errors. I tried to make a small app with Effect and drizzle but i get build errors.
A simple way to reproduce
Build the basic app with “pnpm create effect-app@latest”.
Replace the contents of src/Program.ts with effect git packages/sql-drizzle/examples/sqlite.ts
"pnpm install @effect/sql @effect/sql-drizzle @effect/sql-sqlite-node drizzle-orm@0.31.4" to add missing packages
pnpm run build
I get the following TS2379 and TS2345 errors
src/Program.ts:28:20 - error TS2379: Argument of type 'SQLiteTableWithColumns<{ name: "users"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "users"; dataType
: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; }, object>; name: SQLiteColumn<...>; ...' is not assignable to parameter of type 'SQLiteTable<TableConfig>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
The types of '_.config.columns' are incompatible between these types.
Type '{ id: SQLiteColumn<{ name: "id"; tableName: "users"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; }, object>; name: SQLiteColumn<...>; }' is not assignable to type 'Record<string, SQLiteColumn<any, object>>'.
Property 'id' is incompatible with index signature.
Type 'SQLiteColumn<{ name: "id"; tableName: "users"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumVa
lues: undefined; baseColumn: never; }, object>' is not assignable to type 'SQLiteColumn<any, object>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
The types of 'table._.config.columns' are incompatible between these types.
Type 'Record<string, import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sql
ite-core/columns/common", { with: { "resolution-mode": "import" } }).SQLiteColumn<any, object>>' is not assignable to type 'Record<string, import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sqlite-core/columns/common").SQLiteColumn<any, object>>'.
'string' index signatures are incompatible.
Type 'import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sqlite-core/co
lumns/common", { with: { "resolution-mode": "import" } }).SQLiteColumn<any, object>' is not assignable to type 'import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modu
les/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sqlite-core/columns/common").SQLiteColumn<any, object>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Property 'config' is protected but type 'Column<T, TRuntimeConfig, TTypeConfig>' is not a class derived from 'Column<T, TRuntimeConfig, TTypeConfig>'.
28 yield* db.delete(users)
~~~~~
src/Program.ts:29:20 - error TS2379: Argument of type 'SQLiteTableWithColumns<{ name: "users"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "users"; dataType
: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; }, object>; name: SQLiteColumn<...>; ...' is not assignable to parameter of type 'SQLiteTable<TableConfig>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
The types of '_.config.columns' are incompatible between these types.
Type '{ id: SQLiteColumn<{ name: "id"; tableName: "users"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; }, object>; name: SQLiteColumn<...>; }' is not assignable to type 'Record<string, SQLiteColumn<any, object>>'.
Property 'id' is incompatible with index signature.
Type 'SQLiteColumn<{ name: "id"; tableName: "users"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumVa
lues: undefined; baseColumn: never; }, object>' is not assignable to type 'SQLiteColumn<any, object>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
The types of 'table._.config.columns' are incompatible between these types.
Type 'Record<string, import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sql
ite-core/columns/common", { with: { "resolution-mode": "import" } }).SQLiteColumn<any, object>>' is not assignable to type 'Record<string, import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sqlite-core/columns/common").SQLiteColumn<any, object>>'.
'string' index signatures are incompatible.
Type 'import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sqlite-core/co
lumns/common", { with: { "resolution-mode": "import" } }).SQLiteColumn<any, object>' is not assignable to type 'import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modu
les/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sqlite-core/columns/common").SQLiteColumn<any, object>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Property 'config' is protected but type 'Column<T, TRuntimeConfig, TTypeConfig>' is not a class derived from 'Column<T, TRuntimeConfig, TTypeConfig>'.
29 yield* db.insert(users).values({ id: 1, name: "Alice" })
~~~~~
src/Program.ts:30:43 - error TS2345: Argument of type 'SQLiteTableWithColumns<{ name: "users"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "users"; dataType
: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; }, object>; name: SQLiteColumn<..
.>; ...' is not assignable to parameter of type 'SQLiteTable<TableConfig> | SQL<unknown> | Subquery<string, Record<string, unknown>> | SQLiteViewBase<string, boolean, ColumnsSelection>'.
Type 'SQLiteTableWithColumns<{ name: "users"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "users"; dataType: "number"; columnType: "SQLiteInteger"; data:
number; driverParam: number; notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; }, object>; name: SQLiteColumn<...>; ...' is not assignable to type 'SQLiteTable<TableConfig>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
The types of '_.config.columns' are incompatible between these types.
Type '{ id: SQLiteColumn<{ name: "id"; tableName: "users"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enumValues: undefined; baseColumn: never; }, object>; name: SQLiteColumn<...>; }' is not assignable to type 'Record<string, SQLiteColumn<any, object>>'.
Property 'id' is incompatible with index signature.
Type 'SQLiteColumn<{ name: "id"; tableName: "users"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; hasDefault: true; enum
Values: undefined; baseColumn: never; }, object>' is not assignable to type 'SQLiteColumn<any, object>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
The types of 'table._.config.columns' are incompatible between these types.
Type 'Record<string, import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/s
qlite-core/columns/common", { with: { "resolution-mode": "import" } }).SQLiteColumn<any, object>>' is not assignable to type 'Record<string, import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sqlite-core/columns/common").SQLiteColumn<any, object>>'.
'string' index signatures are incompatible.
Type 'import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_modules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sqlite-core/
columns/common", { with: { "resolution-mode": "import" } }).SQLiteColumn<any, object>' is not assignable to type 'import("D:/mfuku/Documents/projects/scratchProj/effect_sample2/node_mo
dules/.pnpm/drizzle-orm@0.31.4_better-sqlite3@11.7.0/node_modules/drizzle-orm/sqlite-core/columns/common").SQLiteColumn<any, object>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Property 'config' is protected but type 'Column<T, TRuntimeConfig, TTypeConfig>' is not a class derived from 'Column<T, TRuntimeConfig, TTypeConfig>'.
30 const results = yield* db.select().from(users)
~~~~~
Found 3 errors.
What is the expected behavior?
I found to build bellow setting
tsconfig.base.json
"moduleResolution": "node",
"module": "commonjs",
Is there a way to build without changing the settings? Is there any problem with this workaround?
What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
What version of Effect is running?
3.11.5
What steps can reproduce the bug?
Hello, I am trying to build a small app using Effect and drizzle but I keep getting build errors. I tried to make a small app with Effect and drizzle but i get build errors.
A simple way to reproduce
What is the expected behavior?
I found to build bellow setting
tsconfig.base.json
Is there a way to build without changing the settings? Is there any problem with this workaround?
What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: