{"repo":"wsporto/typesql","free":true,"listed":false,"github":"https://github.com/wsporto/typesql","clone":"git clone https://github.com/wsporto/typesql.git","description":"TypeSQL - Generate Typescript API from raw SQL. Supports PostgresSQL, MySQL, Sqlite, LibSQL (Turso) and D1 (Cloudflare)","language":"TypeScript","stars":333,"topics":["sql","mysql","node","deno","typescript","typesafe","raw-sql","sqlite","d1","turso"],"license":"MIT","category":"databases-storage","readme_excerpt":"TypeSQL TypeSQL generates typesafe Typescript APIs from your SQL statements. Write your queries in raw SQL and TypeSQL generates the type-safe APIs to execute those queries. Access your database directly without a heavy ORM, gain effortless type-safety, and make maintaining your SQL simple. TypeSQL supports multiple SQL database backends: PostgreSQL (Experimental) - pg - PostgreSQL client for node.js. MySQL - mysql2 - the standard driver for mysql in NodeJS SQLite - better-sqlite3 - the fastest SQLite driver for NodeJS - bun:sqlite - Bun's official high-performance SQLite driver LibSQL - libsql - the NodeJS driver for libSQL, the open-source fork of SQLite powering Turso Cloudflare D1 - @cloudflare/d1 - Serverless SQLite-compatible database from Cloudflare. Example Having the following query in select-products.sql file. TypeSQL will generate the types and function in the file select-products.ts . Then you can import the generate code and execute as following: deno syntax: Some features: - Do not restrict the use of SQL You dont need to learn any new query language, you can use SQL with all its power and expressiveness. - Infer parameters and columns types. SELECT DATEDIFF(:date1, :date2) as days stayed will resolve the date1 and date2 parameters to the type Date and the function return type as number . - Infer parameter and column nullability. The nullable database column email will generate a nullable field for the query SELECT email FROM mytable , but will generate a non-nu","default_branch":null,"files":null,"tree":[],"storefront":"/r/wsporto","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/wsporto/typesql/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."}