Skip to content

Add 'Schema Creation' Section to drizzle.md: Drizzle SQL Schema and Ts.ED Integration #3146

@Romakita

Description

@Romakita

Objective

Add a new section to the drizzle.md documentation page (created in issue #3145) to explain how to create a Drizzle SQL schema following both Drizzle and Ts.ED conventions, without TypeScript decorators or a Ts.ED-specific module.

Details

  • Add a "Schema Creation" section to drizzle.md.
  • Briefly explain how to declare a standard Drizzle SQL schema, referencing the official Drizzle documentation: https://orm.drizzle.team/docs/sql-schema-declaration
  • Show how to make a Drizzle schema injectable in Ts.ED using injectable().factory().
  • Ensure the documentation works with Ts.ED out of the box, without requiring a dedicated @tsed/drizzle package.
  • Reserve decorator-based schema examples for a future story.

Code example

Add the following code example to help the developer

import { integer, pgTable, varchar } from "drizzle-orm/pg-core";

const users = pgTable('users', {
  id: integer(),
  firstName: varchar('first_name')
})

export const Users = injectable(Symbol.for('Users')).value(users).token()
export type Users = typeof users;

Acceptance Criteria

  • The drizzle.md page has a new section titled "Schema Creation".
  • The section explains the basics of standard Drizzle schema creation and links to the official documentation.
  • The section describes, with example, how to make the schema injectable in Ts.ED using injectable().factory().
  • The code example above is included in the documentation section.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions