Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laurence-myers/rose
Type-safe PostgreSQL query builder and row mapper for Node.js and TypeScript
https://github.com/laurence-myers/rose
Last synced: about 2 months ago
JSON representation
Type-safe PostgreSQL query builder and row mapper for Node.js and TypeScript
- Host: GitHub
- URL: https://github.com/laurence-myers/rose
- Owner: laurence-myers
- Created: 2020-04-19T08:21:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-03T14:43:53.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T08:46:11.140Z (3 months ago)
- Language: TypeScript
- Size: 2.27 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rose
![](https://github.com/laurence-myers/rose/workflows/Rose%20CI/badge.svg)
[![codecov](https://codecov.io/gh/laurence-myers/rose/branch/master/graph/badge.svg)](https://codecov.io/gh/laurence-myers/rose)`rose` is a PostgreSQL query builder and row mapper for TypeScript.
To get started, please read the online documentation:https://laurence-myers.github.io/rose/
## Goals
`rose` has the following goals:
- To provide a type-safe interface between your TypeScript application and the PostgreSQL query language.
- To mimic the SQL syntax as closely as possible using a Domain Specific Language (DSL)
- To support custom queries beyond basic CRUD. This includes:
- Joining arbitrary tables, including sub-selects
- Common table expressions
- "Upserts" (`INSERT ... ON CONFLICT ...`)
- Transactions
- Composite primary keys
- To allow dynamically composing queries, _or_ pre-compiled queries.
- To treat your database as the source of truth for your data schema.
- Avoid concatenating strings at all costs.## Project structure
### rose
This is the core library you import into your application. It provides the query building and row mapping functionality.
### rose-cli
This introspects your database schema and generates "metamodel" code.
### rose-docs
This generates the online documentation. Code examples are tested against the real codebase.
### rose-example
This is a demonstration of how you can use `rose` in your application.
## Development
### Publishing a new version
```
cd rose
yarn publish:npmcd ../rose-docs
yarn publish:npm
```Increment the `version` in each project's `package.json`