• Stars
    star
    208
  • Rank 189,015 (Top 4 %)
  • Language
    JavaScript
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

InterPlanetary SQL

IPSQL

IPSQL is a decentralized database that can run in IPFS. It implements the SQL schema, data model, and query language.

This project is pre-alpha and under heavy active development. Do not use in production, breaking changes will land without notice.

The JS API is currently considered internal until the churn in the code base dies down.

  • Features
    • Traditional SQL CREATE, UPDATE, SELECT, WHERE, etc.
    • Deltas and proofs for every database operation and query.
      • You can replicate the data for only a single query as hash linked blocks.
      • Every mutation creates deltas to prior states and even query deltas can be replicated.
    • Optional Encryption
    • DAG Tables (JSON-like unstructured objects as rows, with column indexing an SQL queries still available)

This project is built using a tree building technique implemented in the chunky-trees module.

CLI

The primary way to interact with IPSQL right now is via the command line. You can install it with npm or use npx to run it without installing locally.

$ ipsql help
ipsql [command]

Commands:
  ipsql query <uri> <sql>    Run IPSQL query
  ipsql repl <uri>           Run local REPL
  ipsql create <sql>         Create a new database
  ipsql write <uri> <sql>    Mutate an existing SQL database
  ipsql import <subcommand>  Import CSV files
  ipsql keygen <subcommand>  Generate keys for encryption

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

SQL Feature Checklist

  • CREATE
    • DATABASE (it isn't clear how we would want to implement and support this yet)
    • TABLE
      • INTEGER
      • VARCHAR(size)
      • FLOAT
      • DATE
      • TIME
      • DATETIME
      • BLOB (should use the FBL, values smaller than 32b will be inline binary, below 1MB should be a single raw block link, anything else is a full tree FBL as a stream)
      • TEXT (may never support, according to spec this is upt 2GB of string data so it's hard to figure out what the inline vs linking rules would be. Instead, using VARCHAR as the inlined string and BLOB the probably linked type)
  • ALTER TABLE
  • INSERT
    • ROWS INSERT INTO table_name VALUES ( 'test' )
    • COLUMNS INSERT INTO table_name ( column_name ) VALUES ( 'test' )
  • UPDATE
    • UPDATE SET w/o WHERE
    • UPDATE SET WHERE
  • DELETE
    • DELETE w/o WHERE (deletes table)
    • DELETE WHERE
  • SELECT
    • * SELECT * FROM table_name
    • COLUMNS SELECT column1, column2 FROM table_name
    • ROWID meta column
    • TOP
    • MIN
    • MAX
    • COUNT
    • AVG
    • SUM
    • LIKE pattern
    • WHERE
      • AND
      • OR
      • ASC, DESC
      • basic comparison (=, >, <, >=, <=)
      • <>
      • GROUP BY
      • ORDER BY
      • BETWEEN
      • LIKE
      • IN
      • NOT
      • IS NOT NULL, IS NULL
    • JOIN
    • ORDER BY
    • GROUP BY
    • HAVING
    • UNION

IPLD Schema

type Column {
  schema &Map
  index nullable &DBIndex
}
type Columns { String: Column }

type Table struct {
  columns Columns
  rows nullable &SparseArray
}
type Tables { String: Table }

type Database struct {
  tables Tables
}

More Repositories

1

r2

HTTP client. Spiritual successor to request.
JavaScript
4,473
star
2

bent

Functional JS HTTP client (Node.js & Fetch) w/ async await
JavaScript
2,198
star
3

roll-call

๐Ÿ“ž Free and reliable audio calls for everyone w/ browser p2p.
JavaScript
1,566
star
4

watch

Utilities for watching file trees in node.js
JavaScript
1,273
star
5

spider

Programmable spidering of web sites with node.js and jQuery
JavaScript
725
star
6

webtorrent-element

WebTorrent HTML element.
JavaScript
526
star
7

merge-release

Automatically release all merges to master on npm.
JavaScript
468
star
8

node.couchapp.js

Utility for writing couchapps.
JavaScript
407
star
9

tako

Functional web framework.
JavaScript
320
star
10

sequest

Simplified API for SSH and SFTP similar to request.
JavaScript
283
star
11

filed

Simplified file library.
JavaScript
282
star
12

daily

Whatโ€™s happening in Open Source. Everyday ๐Ÿค“
JavaScript
262
star
13

dropub

P2P publishing for everyone.
Vue
222
star
14

znode

Bi-directional RPC through any stream.
JavaScript
205
star
15

reg

Native ESM Package Manager
JavaScript
175
star
16

node-utils

A collection of small, simple, and useful node packages.
JavaScript
173
star
17

markdown-element

HTML Element that renders markdown content.
JavaScript
137
star
18

dagdb

Syncable database built on IPLD
JavaScript
135
star
19

publish-to-github-action

A GitHub Action to push any local file changes, including new files, back to master
Dockerfile
109
star
20

browsercouch

CouchDB in the browser
JavaScript
98
star
21

rza

Create simple HTML elements
JavaScript
92
star
22

prolly-trees

Hash consistent search trees.
JavaScript
89
star
23

gza

Functional custom HTML elements.
JavaScript
88
star
24

self-care

Discussion repo for developers to share their self-care routines
88
star
25

shaolin

The easiest way to build Web Components.
JavaScript
87
star
26

snapkit

Capture screenshots of websites on command line or REST API.
JavaScript
83
star
27

jaws

Build HTTP applications as a cache.
JavaScript
77
star
28

killa-beez

๐Ÿ We on a WebRTC Swarm!
JavaScript
73
star
29

response

๐Ÿ„๐Ÿป Streaming and mutation API for HTTP responses.
JavaScript
73
star
30

node.couch.js

CouchDB + node.js == Crazy Delicious
JavaScript
70
star
31

couchup

A CouchDB implementation on top of levelup.
JavaScript
66
star
32

jspp

JavaScript Pre-Processor
JavaScript
60
star
33

vuejs-electron-demo

Simple Vue.js Electron demo
Vue
59
star
34

zcomponent

DEPRECATED: Use rza for a class based approach or gza for a functional approach.
JavaScript
57
star
35

vanilla

Compile-to-JavaScript language for people that write JavaScript
JavaScript
55
star
36

dkv

Decentralized key-value store running on IPFS
JavaScript
53
star
37

replicate

A customizable CouchDB replicator in node.js.
JavaScript
52
star
38

cappadonna

Headless browser testing for tap with coverage reporting.
JavaScript
48
star
39

tweetstream

node.js stream API for the twitter streaming HTTP API
JavaScript
47
star
40

way-of-code

Organizing my thoughts about the process and states of mind of programming
45
star
41

distjs

Distribute standalone WebComponents w/ npm.
JavaScript
41
star
42

ipjs

Universal JavaScript Build and Packaging
JavaScript
41
star
43

planet

A node.js planet (blog aggregator)
CSS
40
star
44

morestreams

Collection of useful stream objects.
JavaScript
40
star
45

funky

๐Ÿ’ช๐Ÿฟ Front-end view system using basic functional programming and template literals.
JavaScript
40
star
46

couchdb-pythonviews

Python view server for CouchDB.
JavaScript
40
star
47

bytesish

Cross-Platform Binary API
JavaScript
35
star
48

stud-proxy

Round Robin proxy/balancer for the stud TLS terminator
JavaScript
33
star
49

dbemitter

EventEmitters for remote database events
JavaScript
32
star
50

couchdb-wsgi

WSGI compliant handler for CouchDB external processes.
Python
32
star
51

getport

Find an open port to listen on.
JavaScript
32
star
52

redcouch

A client that stores data in both CouchDB and Redis.
JavaScript
32
star
53

sustainable-oss

Sustainable Open Source: The Book (Maybe)
31
star
54

nodeconf2013

NodeConf 2013 Planning and Sessions
JavaScript
31
star
55

SLEEP

Implementation of the SLEEP protocol.
JavaScript
29
star
56

bundle-size-action

Calculate the bundle size of your module. Useful for GitHub Actions.
JavaScript
28
star
57

occupy

Deployment for the 99%
JavaScript
28
star
58

ipfs-elements

HTML Elements for IPFS.
JavaScript
27
star
59

estest

ESM native testing across all JS platforms.
JavaScript
24
star
60

couchcache

CouchCache is a finely tuned caching HTTP proxy for CouchDB written in node.js
JavaScript
24
star
61

ZDAG

JSON/CBOR style format as a compressor
JavaScript
24
star
62

couch

Stupid simple Couch wrapper based on Request
JavaScript
24
star
63

framework

A framework for node.js (inspired by vapor.js)
JavaScript
23
star
64

sst

Super Simple Test Format
23
star
65

raindrop

git checkout of the labs.mozilla.com/raindrop hg repo
JavaScript
22
star
66

hostproxy

HTTP Proxy that searches for Host header and avoids any parsing
JavaScript
22
star
67

relaximation

Some relaxed automation
JavaScript
21
star
68

learnjs

Workshopper for learning JavaScript.
JavaScript
21
star
69

compretend

Web application building blocks power by ML.
JavaScript
20
star
70

buddhism.js

Buddhist concepts as JavaScript
20
star
71

webtouch

Validate that a web site and all its required resources are available.
JavaScript
20
star
72

couchie

Minimalist localStorage database API. Works well as a cache for CouchDB documents.
JavaScript
20
star
73

lucass

Lightweight Universal Content Addressable Storage Spec
JavaScript
18
star
74

peer-room

Ephemeral and secure peer-to-peer chat rooms.
JavaScript
17
star
75

requirein

A require() that works in a specified directory.
JavaScript
17
star
76

jsonfiles

Simple database as flat JSON files.
JavaScript
17
star
77

bong-bong

Open public chat service built for the web.
JavaScript
17
star
78

siofile

Stream a file to a socket.io client.
JavaScript
16
star
79

signal-exchange

WebRTC signal exchange using public keys and socket.io
JavaScript
16
star
80

mikeal.js

My blog code, node-couchapp and sammy.js code.
JavaScript
16
star
81

brrp

ESM bundle npm modules for browsers and nodejs
JavaScript
15
star
82

tasked

Background task state machines on top of CouchDB.
JavaScript
15
star
83

stoopid

Loggers are stupid and I'm resentful that I had to write this.
JavaScript
15
star
84

deferred

Deferred objects without Twisted
Python
15
star
85

methodman

Bidirectional rpc and streams for WebSockets and WebRTC.
JavaScript
14
star
86

iterp

Controlled parallelism w/ async iterables.
JavaScript
14
star
87

block-box

Universal hash addressed block container.
JavaScript
14
star
88

node.proxy.js

HTTP Proxy for node.js
JavaScript
14
star
89

go-stats

Crunching some data on the size of the Go ecosystem.
JavaScript
14
star
90

pushdb

A programmable database with document storage and unique indexing capabilities.
JavaScript
13
star
91

car-transaction

IPLD transaction as CAR buffer [for use in databases]
JavaScript
13
star
92

matrika

Next Generation Decentralized Database
JavaScript
13
star
93

level-mutex

Mutex read/write lock for levelup.
JavaScript
13
star
94

php-analytics

Scripts to pull down dependency analytics for PHP packages.
JavaScript
13
star
95

githubarchive

Streaming parsers for the github archive.
JavaScript
12
star
96

requestdb

A request wrapper that stores and retrieves responses from a leveldb cache.
JavaScript
12
star
97

brasstacks

A large scale results and graphing server using CouchDB.
JavaScript
12
star
98

waudio

Web Audio made sane.
JavaScript
12
star
99

logref

Logging for node.js
JavaScript
12
star
100

libp2p-simple

Pre-configured libp2p for browser and node.js.
JavaScript
12
star