-
-
Notifications
You must be signed in to change notification settings - Fork 291
Open
Open
Copy link
Labels
Description
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/drizzlepackage. - 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.mdpage 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.