Code Monkey home page Code Monkey logo

ipsql's Introduction

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.

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:
  bin.js query <uri> <sql>  Run IPSQL query
  bin.js repl <uri>         Run local REPL
  bin.js import             Import CSV files

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

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

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)
      • BOOLEAN (this isn't actually supported in the SQL parser we use, must be quite rare)
  • 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
}

ipsql's People

Contributors

mikeal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.