Leonardo Barbosa - Creatus
Leonardo Barbosa - Creatus
DTDrizzle Team
Created by Leonardo Barbosa - Creatus on 4/9/2024 in #help
Invalid drizzle query
I'm trying to run a search for tests using drizzle studio, but I'm getting this error: invalid drizzle query.
db.query.users.findMany();
db.query.users.findMany();
Schema
import {
sqliteTable,
AnySQLiteColumn,
uniqueIndex,
text,
integer,
} from "drizzle-orm/sqlite-core";
import { sql } from "drizzle-orm";

export const users = sqliteTable(
"users",
{
id: text("id").primaryKey().notNull(),
name: text("name").notNull(),
registration: text("registration").notNull(),
createdAt: integer("created_at"),
level: integer("level").notNull(),
password: text("password").notNull(),
intModifiers: integer("int_modifiers").default(false).notNull(),
},
(table) => {
return {
registrationUnique: uniqueIndex("users_registration_unique").on(
table.registration,
),
};
},
);
import {
sqliteTable,
AnySQLiteColumn,
uniqueIndex,
text,
integer,
} from "drizzle-orm/sqlite-core";
import { sql } from "drizzle-orm";

export const users = sqliteTable(
"users",
{
id: text("id").primaryKey().notNull(),
name: text("name").notNull(),
registration: text("registration").notNull(),
createdAt: integer("created_at"),
level: integer("level").notNull(),
password: text("password").notNull(),
intModifiers: integer("int_modifiers").default(false).notNull(),
},
(table) => {
return {
registrationUnique: uniqueIndex("users_registration_unique").on(
table.registration,
),
};
},
);
12 replies