{"repo":"a2lix/schemql","free":true,"listed":false,"github":"https://github.com/a2lix/schemql","clone":"git clone https://github.com/a2lix/schemql.git","description":"A lightweight TypeScript library that enhances your SQL workflow by combining raw SQL with targeted type safety and schema validation","language":"TypeScript","stars":31,"topics":["autocomplete","database","query","schema","sql","type-safe","typescript","validation","zod"],"license":"MIT","category":"databases-storage","readme_excerpt":"SchemQl SchemQl simplifies database interactions by allowing you to write advanced SQL queries that fully leverage the features of your DBMS, while providing type safety through the use of schemas and offering convenient execution methods. Key features: - Database agnostic : Compatible with any DBMS. - SQL-first : Write SQL with precise type checks on literals like tables, columns (JSON fields & some JSONPath included), and parameters. - Flexible parameters Supports single objects, arrays of objects, and asynchronous generators for parameters. - Schema-agnostic : Use any validation library implementing Standard Schema (Zod, ArkType, Effect, etc.) to validate and parse parameters and query results. - Iterative Execution Process large datasets efficiently using asynchronous generators. Installation To install SchemQl, use: Usage Here's a basic example of how to use SchemQl: 1. Create your database schema and expose it with a DB interface Tip: Use your favorite AI to generate a schema from your SQL. If using JSON data, leverage the built-in parseJsonPreprocessor . With Zod: With ArkType: // ... 2. Initialize your instance of SchemQl with the DB interface typing Example with better-sqlite3 adapter. 3. Use your instance of SchemQl with .first() / .firstOrThrow() / .all() / .iterate() Simple use with resultSchema only and no SQL literal string More advanced example Automatically stringify JSON params 'metadata' (by schemQl if enabled) and get parsed JSON metadata, as well (if your ","default_branch":null,"files":null,"tree":[],"storefront":"/r/a2lix","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/a2lix/schemql/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}