Cursor rule
.cursor/rules/db.mdcDatabase rules for working with drizzle schemas and creating backend apis
Cursor rules
Quality
44/100
Scores the file, not the repository.Length
139 words
0 headings · 2 code blocksRepository
29
— · pushed 46 days agoLast changed
3 days ago
First indexed 3 days ago.123456Leverage strings with drizzle types, instead of enums:7`status: text("status").$type<pending | cancelled |error >().notNull()`89Only use varchar for ids, similiar to the users table. Otherwise use text.1011When creating a new table, leverage the id util `packages/id/src/generate.ts`12<new_table_prefix>13```ts14`packages/id/generate.ts`1516const prefixes = {17 post: "post",18 property: "prop",19 // Add new prefixes here20} as const;21```22For generate.ts, all you have to do is add the table name (or varation) as a key to the const. No need to use nanoid or change any other code.23Also abbreviate longer words, i.e property: "cust",24252627Then inside `packages/db/schema.ts` you can use it like so:28```ts29export const properties = pgTable("properties", {30 id: varchar("id", { length: 255 })31 .primaryKey()32 .$defaultFn(() => newId("property"))33}34```35</new_table_prefix>3637Users table doesn't need items like avatar or name, unless specificially required to sync via clerk38
Also in AsharibAli/ramadan-prompting-nights
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| AsharibAli/ramadan-prompting-nights.cursor/rules/api.mdc · 29 | Cursor rules | setuptesttypessecurity+3 | 78/100 | 3 days ago | |
| AsharibAli/ramadan-prompting-nights.cursor/rules/frontend.mdc · 29 | Cursor rules | setuptestlint-formatstyle+7 | 91/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
