Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.devcontainer
dist
.vscode
.vscode
.rollup_cache
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
# Skytable NodeJS Driver
# `skytable-node`: Skytable driver for NodeJS

This is the skeleton template repository for Skytable's NodeJS driver. You can [track the implementation here](https://github.com/skytable/skytable/issues/324)!
## Getting started

Tasks:
- [ ] Implement a basic Skytable client driver for NodeJS
- [ ] Functionality:
- [ ] Implement the full Skyhash protocol
- [ ] Be able to send and receive queries and decode them ergonomically (into appropriate objects and/or types)
- [ ] Should have a way to use TLS
```shell
yarn add skytable-node
```

> For contributors: You might find the [Rust client driver](https://github.com/skytable/client-rust) to be a good reference.
> We're here to help! Please jump into our [Discord Community](https://discord.gg/QptWFdx); we're here to mentor you.
## Example

```js
const { Config, Query } = require('skytable-node');
const cfg = new Config("root", "password");

async function main() {
let db;
try {
db = await cfg.connect();
console.log(await db.query(new Query("sysctl report status")));
} catch (e) {
console.error(e);
process.exit(1);
} finally {
if (db) {
await db.disconnect();
}
}
}

main()
```

## License

Expand Down
20 changes: 20 additions & 0 deletions __tests__/dcl.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Config, Query } from '../src';

const cfg = new Config('root', 'password');

async function main() {
let db;
try {
db = await cfg.connect();
console.log(await db.query(new Query('sysctl report status')));
} catch (e) {
console.error(e);
process.exit(1);
} finally {
if (db) {
await db.disconnect();
}
}
}

main();
73 changes: 0 additions & 73 deletions __tests__/ddl.spec.ts

This file was deleted.

122 changes: 0 additions & 122 deletions __tests__/dml.spec.ts

This file was deleted.

25 changes: 0 additions & 25 deletions __tests__/utils.ts

This file was deleted.

19 changes: 19 additions & 0 deletions examples/simple.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { Config, Query } = require('skytable-node');
const cfg = new Config('root', 'password');

async function main() {
let db;
try {
db = await cfg.connect();
console.log(await db.query(new Query('sysctl report status')));
} catch (e) {
console.error(e);
process.exit(1);
} finally {
if (db) {
await db.disconnect();
}
}
}

main();
36 changes: 0 additions & 36 deletions examples/simple.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "skytable-node",
"version": "0.1.2",
"version": "0.2.0",
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
"module": "dist/esm/index.mjs",
Expand Down
Loading