© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•17mo ago•
5 replies
!skyfall

How to generate type for individual items?

I have a
schema.ts
schema.ts
here:
import { sql } from 'drizzle-orm';
import { text, integer, sqliteTable } from 'drizzle-orm/sqlite-core';

export const comments = sqliteTable('comments', {
    url: text('url'),
    authorId: text('author_id').notNull(),
    upvotes: integer('upvotes').notNull().default(0),
    downvotes: integer('downvotes').notNull().default(0),
    parentId: text('parent_id'), // For replies, null if it's a top-level comment
    timestamp: text('timestamp')
        .notNull()
        .default(sql`CURRENT_TIMESTAMP`)
});

export const users = sqliteTable('users', {
    id: text('id').primaryKey(),
    name: text('name').notNull(),
    email: text('email').notNull().unique()
});
import { sql } from 'drizzle-orm';
import { text, integer, sqliteTable } from 'drizzle-orm/sqlite-core';

export const comments = sqliteTable('comments', {
    url: text('url'),
    authorId: text('author_id').notNull(),
    upvotes: integer('upvotes').notNull().default(0),
    downvotes: integer('downvotes').notNull().default(0),
    parentId: text('parent_id'), // For replies, null if it's a top-level comment
    timestamp: text('timestamp')
        .notNull()
        .default(sql`CURRENT_TIMESTAMP`)
});

export const users = sqliteTable('users', {
    id: text('id').primaryKey(),
    name: text('name').notNull(),
    email: text('email').notNull().unique()
});

How do I generate individual
Comment
Comment
and
User
User
types? Thanks!
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how to generate type from schema
Drizzle TeamDTDrizzle Team / help
2y ago
how to group Related Items
Drizzle TeamDTDrizzle Team / help
3y ago
customType generate type with double quotes
Drizzle TeamDTDrizzle Team / help
2y ago
Unable to generate migration for sqlite
Drizzle TeamDTDrizzle Team / help
3y ago