{"repo":"tureluren/refql","free":true,"listed":false,"github":"https://github.com/tureluren/refql","clone":"git clone https://github.com/tureluren/refql.git","description":"A library for composing and running database queries with rich IntelliSense and type safety","language":"TypeScript","stars":21,"topics":["nodejs","query-language","sql","fantasy-land","functional-programming","semigroup","query-builder","typescript","orm"],"license":"MIT","category":"databases-storage","readme_excerpt":"RefQL A library for composing and running database queries with rich IntelliSense and type safety. Installation Create RefQL instance Introspect the database schema (PostgreSQL only; should be run separately from the main project) Easily read referenced data using an RQLTag Table of contents Fantasy Land interoperability Options Querier Tables and references Operator mix Insert, update and delete SQLTag Fantasy Land interoperability Both RQLTag and SQLTag are Semigroup structures. Options Querier The querier should have the type signature (query: string, values: any[]) = Promise . This function is a necessary in-between piece to make RefQL independent from database clients. This allows you to choose your own client. This is also the place where you can debug or transform a query before it goes to the database or when the result is obtained. Example of a querier for mySQL: Convert Promise output to something else using the runner U can use Module augmentation in TypeScript to register another container type. Tables and references For now, introspection only works for PostgreSQL databases. The example below shows how u can define tables and describe their references to other tables. Relationships are created by passing the table name as a string instead of passing a Table object. This is to avoid circular dependency problems. Tables are uniquely identifiable by the combination schema and tableName ( . ) . Ref info RefQL tries to link 2 tables based on logical column names, usin","default_branch":null,"files":null,"tree":[],"storefront":"/r/tureluren","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tureluren/refql/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."}