Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Metabase | 32,610 | 15 hours ago | 1 | June 08, 2022 | 3,028 | other | Clojure | |||
The simplest, fastest way to get business intelligence and analytics to everyone in your company :yum: | ||||||||||
Dbeaver | 32,255 | 10 hours ago | 1,746 | apache-2.0 | Java | |||||
Free universal database tool and SQL client | ||||||||||
Redash | 23,239 | a day ago | 2 | May 05, 2020 | 791 | bsd-2-clause | Python | |||
Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data. | ||||||||||
Directus | 21,761 | 50 | 8 hours ago | 55 | September 22, 2022 | 229 | other | TypeScript | ||
The Modern Data Stack 🐰 — Directus is an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database. | ||||||||||
Postgrest | 20,617 | 4 | a day ago | 37 | July 12, 2022 | 207 | mit | Haskell | ||
REST API for any Postgres database | ||||||||||
Shardingsphere | 18,454 | 8 | 8 hours ago | 7 | June 04, 2020 | 666 | apache-2.0 | Java | ||
Ecosystem to transform any database into a distributed database system, and enhance it with sharding, elastic scaling, encryption features & more | ||||||||||
Knex | 17,614 | 18,096 | 2,788 | 3 days ago | 248 | August 31, 2022 | 830 | mit | JavaScript | |
A query builder for PostgreSQL, MySQL, CockroachDB, SQL Server, SQLite3 and Oracle, designed to be flexible, portable, and fun to use. | ||||||||||
Cube | 15,644 | 18 hours ago | 758 | other | Rust | |||||
📊 Cube — The Semantic Layer for Building Data Applications | ||||||||||
Apijson | 15,374 | 10 hours ago | 218 | other | Java | |||||
🏆 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构。 🏆 A JSON Transmission Protocol and an ORM Library 🚀 provides APIs and Docs without writing any code. | ||||||||||
Timescaledb | 15,041 | 14 hours ago | 533 | other | C | |||||
An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension. |
Latest Release: v10.4.1, Latest Major Release: v10.0.0, All Releases
Complex queries can be written with normal SQL, including the values needs to be bound and prefixed with the sql tag.
![]() |
Make the id variable? | ![]() |
Or even more simple? | ![]() |
pg
as database drivernpm install --save pg sql-pg
Use it in your project:
const sql = require('sql-pg')()
The connection use per default the env var DATABASE_URL
. It will only establish a database connection if manipulation/selection methods are used. Alternatively it's possible to provide a sql.js
to customize the database connecting and sql
object initializing.
Simple data manipulation can be done without writing any SQL Statements.
E.g. some user data manipulation:
const id = await sql.insert(
'users',
{ name: 'Sharaal', email: '[email protected]', passwordhash: '...' }
)
await sql.update('users', { validated: 1 }, { id })
await sql.delete('users', { id })
More complex data manipulation can be done with the SQL Tag.
Often needed convenient methods to check and extract query results are available with the Selection Methods.
E.g. select all not validated users:
const users = await sql.any('users', ['name', 'email'], { validated: 0 })
Also the Selection Methods supports SQL Tag as parameter for more complex selections. Because they are highly inspired by pg-promise
, there are the Selection Methods any
/manyOrNone
, many
, oneOrNone
and one
available.
If it becomes more complex the SQL Tag and Tag Helpers are the way to go.
They are as near as possible to native SQL queries to be readable and easy to write. All variables can be directly used and will be exchanged via placeholders and given to the database separately as values. For non native values like lists, for table/column names and conditions there are Tag Helpers.
E.g. list of not activated users filtered by name:
const name = 'raa'
const users = await sql.any(
sql`
SELECT "name", "email" FROM "users"
WHERE
"validated" = 0
AND
"name" LIKE ${`%${name}%`}
`
)
There are a lot more Tag Helpers available like .identifier
, .table
, .column(s)
, .value(s)
, .valuesList
, .assignments
, .conditions
, .limit
, .offset
, .pagination
, .if
, .jsonColumnObject
and .jsonColumnText
.
Alternative initialization, available Tag Helpers, Nested Queries, Transaction, Writing Tag Helpers, Migrations, Syntax Highlighting in Atom... All additional documentation can be found in the Wiki.
Found a bug or missing a feature? -> Create a new Issue
Found a security issue? -> Look at the Security Policy
Having questions, want to give feedback or talk to me? -> E-Mail me [email protected]