https://github.com/gamote/cifru
Cypher queries with no strings attached! ๐
https://github.com/gamote/cifru
cypher cypher-query cypher-query-language graph-database neo4j orm query-builder redis-graph typescript
Last synced: 6 months ago
JSON representation
Cypher queries with no strings attached! ๐
- Host: GitHub
- URL: https://github.com/gamote/cifru
- Owner: Gamote
- Created: 2023-08-23T14:06:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-08T14:56:17.000Z (about 2 years ago)
- Last Synced: 2025-04-09T13:17:06.441Z (about 1 year ago)
- Topics: cypher, cypher-query, cypher-query-language, graph-database, neo4j, orm, query-builder, redis-graph, typescript
- Language: TypeScript
- Homepage:
- Size: 228 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# cifru
[](https://www.npmjs.com/package/cifru)
[](https://www.npmjs.com/package/cifru)
**Cifru** (๐ฃ `[หtอกสifru]`): cypher queries with no strings attached! Dive into our lightweight ORM that makes writing production-ready queries feel like a breeze.
- **String validation at compile time**: uses TypeScript template literals to validate node and relation names, ensuring correct format before runtime.
## Installation
```bash
yarn add cifru
```
## Usage
```ts
import c, { Direction } from 'cifru';
const query = c
.match(
c
.node({
variable: 'a',
labels: ['Actor'],
properties: { name: 'Cami' },
})
.relation({
direction: Direction.Outgoing,
variable: 'r',
labels: ['ACTED_IN'],
properties: { roles: ['Trinity'] },
})
.node({
variable: 'm',
labels: ['Movie'],
properties: { name: 'The Matrix' },
}),
)
.return('a')
.query();
console.log(query);
// => MATCH (a:Actor {name: 'Cami'})-[r:ACTED_IN {roles: 'Trinity'}]->(m:Movie {name: 'The Matrix'})
// RETURN a
```
## Testing
```bash
yarn test
```