Skip to content

Commit 334a0cf

Browse files
committed
Update README
1 parent 137bd8e commit 334a0cf

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ A super lightweight TypeScript types generator that respects your laziness and l
2323

2424
Zero runtime dependencies, just types. This is just a super thin wrapper around [sqlc](https://sqlc.dev/) and a file generator - all the real magic is in sqlc. It just makes it more convenient to use in TypeScript projects.
2525

26-
## TLDR
26+
## 🏃 TLDR
2727

2828
- `pg_dump --schema-only postgres://user:password@localhost:5432/database > schema.sql` to dump your schema
2929
- Run `npx sqlc-typescript watch` (`src/**/*.ts` is default glob and `schema.sql` is default schema file)
@@ -114,7 +114,7 @@ Create a `sqlc.json` in your project root:
114114
}
115115
```
116116

117-
## Usage 💻
117+
## 💻 Usage
118118

119119
1. Write your SQL queries in TypeScript files using the `/*sql*/` tag:
120120

@@ -174,9 +174,12 @@ The key difference: We use sqlc's SQL parser instead of PostgreSQL wire protocol
174174
- No database connection needed
175175
- Just need a schema dump (`pg_dump --schema-only`)
176176

177-
## SQL Formatting 💅
177+
## 💅 SQL Formatting
178178

179-
You can use Prettier with SQL plugins to format your queries inside the template literals. The generator preserves formatting and comments.
179+
You can use Prettier with SQL plugins to format your queries inside the template literals.
180+
181+
- https://github.com/un-ts/prettier
182+
- https://github.com/Sec-ant/prettier-plugin-embed
180183

181184
```typescript
182185
// This will be properly formatted
@@ -192,18 +195,18 @@ sqlc(/*sql*/ `
192195
`).exec(client);
193196
```
194197

195-
## Roadmap 🛣️
198+
## 🛣️ Roadmap
196199

197200
- Support for all sqlc features and database support beyond PostgreSQL
198201
- Automatic result unflattening using column aliases
199202

200-
## Limitations ⚠️
203+
## ⚠️ Limitations
201204

202205
- PostgreSQL only (for now)
203206
- Queries must be statically analyzable (no dynamic SQL) which is good and bad at the same time
204207
- All queries must use the `/*sql*/` tag until TypeScript supports generic template literals
205208

206-
## Credits 🙏
209+
## 🙏 Credits
207210

208211
Big thanks to:
209212

0 commit comments

Comments
 (0)