All Projects → lspgn → Edge Sql

lspgn / Edge Sql

Cloudflare Workers providing a SQL API

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Edge Sql

Sql.js
A javascript library to run SQLite on the web.
Stars: ✭ 9,594 (+2136.36%)
Mutual labels:  emscripten, sql, database, wasm
Deno Sqlite
Deno SQLite module
Stars: ✭ 151 (-64.8%)
Mutual labels:  database, sqlite3, wasm
Sqlcheck
Automatically identify anti-patterns in SQL queries
Stars: ✭ 2,062 (+380.65%)
Mutual labels:  sql, database, sqlite3
Electrocrud
Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
Stars: ✭ 1,267 (+195.34%)
Mutual labels:  sql, database, sqlite3
Siodb
The simplicity of REST and the power of SQL combined in a database that automatized security and performance. Forget the database, develop faster and safer!
Stars: ✭ 31 (-92.77%)
Mutual labels:  serverless, sql, database
Better Sqlite3
The fastest and simplest library for SQLite3 in Node.js.
Stars: ✭ 2,778 (+547.55%)
Mutual labels:  sql, database, sqlite3
Qb
The database toolkit for go
Stars: ✭ 524 (+22.14%)
Mutual labels:  sql, database, sqlite3
Web Database Analytics
Web scrapping and related analytics using Python tools
Stars: ✭ 175 (-59.21%)
Mutual labels:  sql, database, sqlite3
Tidb
TiDB is an open source distributed HTAP database compatible with the MySQL protocol
Stars: ✭ 29,871 (+6862.94%)
Mutual labels:  serverless, sql, database
Squeal
A Swift wrapper for SQLite databases
Stars: ✭ 303 (-29.37%)
Mutual labels:  sql, database, sqlite3
Dbeaver
Free universal database tool and SQL client
Stars: ✭ 23,752 (+5436.6%)
Mutual labels:  sql, database
Jet
Type safe SQL builder with code generation and automatic query result data mapping
Stars: ✭ 373 (-13.05%)
Mutual labels:  sql, database
Hive
Apache Hive
Stars: ✭ 4,031 (+839.63%)
Mutual labels:  sql, database
Wac
WebAssembly interpreter in C
Stars: ✭ 372 (-13.29%)
Mutual labels:  emscripten, wasm
Walkable
A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind
Stars: ✭ 384 (-10.49%)
Mutual labels:  sql, sqlite3
Pg timetable
pg_timetable: Advanced scheduling for PostgreSQL
Stars: ✭ 382 (-10.96%)
Mutual labels:  sql, database
Grdb.swift
A toolkit for SQLite databases, with a focus on application development
Stars: ✭ 4,637 (+980.89%)
Mutual labels:  sql, database
Franchise
🍟 a notebook sql client. what you get when have a lot of sequels.
Stars: ✭ 3,823 (+791.14%)
Mutual labels:  sql, database
Sqlboiler
Generate a Go ORM tailored to your database schema.
Stars: ✭ 4,497 (+948.25%)
Mutual labels:  database, sqlite3
Hyrise
Hyrise is a research in-memory database.
Stars: ✭ 371 (-13.52%)
Mutual labels:  sql, database

edge-sql

Deploy

A Cloudflare Worker embedding SQLite with WASM and a simple Forex dataset.

You can preview it here: https://sql.lspgn.workers.dev.

Why?

I had an idea. Here's a little backstory.

Many services provide a REST API on top of a SQL database. For certain datasources, flexibility in terms of queries is key. Often those use-cases are dashboard prototyping, for example with Grafana.

This data is usually read-only statistical datasets where the user needs to run many queries in order to troubleshoot an issue or just find the best visualization. Often this requires complex queries and extensive accesses or quotas. Using regular REST APIs would require a lot of back-and-forth between the developers and the analysts. Recent initiatives like GraphQL are aimed at these issues and hope to provide more flexibility.

The idea behind this fun project is that serverless concepts can be applied for this use-case and have SQL as an execution model. Foreign Data Wrappers are similar as they provide a framework that works with a Query Processor but need to rely on more traditional user control and quotas configurations.

Currently, tools like BigQuery are used in multi-tenancy environments and allow user to execute their SQL program without worrying about data infrastructure.

Through this fun prototype on the Cloudflare Workers platform, we can put a sandbox around a SQL program and play with data stored in Worker KVs.

The current setup is meant to use minimal resources (Free limits). This is a proof of concept that was made possible by SQLite code that can fit inside the plateform (<1MB). Obviously, a rework of the code would be required to make it usable in a production environment. Features like sharding the data and the querying are necessary for large datasets, along with user control. The current quotas are controlled by the platform which can stop the execution of the entire Worker if it goes above the allowed limits.

Data

The data used in production is a reduced version (only EUR, JPY, GBP and CHF currencies) of the European Central Bank Forex Rates on Humdata. And is distributed under the license CC-BY.

Try

The following query will return the days when the British pound was at its lowest and highest against the dollar.

$ curl -XPOST --data \
"
SELECT *,1/EUR,1/JPY,1/GBP,1/CHF
FROM forex
WHERE
  GBP = (
    SELECT
      max(GBP)
    FROM forex)
  OR GBP = (
    SELECT
      min(GBP)
    FROM forex)
" \
-H 'content-type: application/text' \
https://sql.lspgn.workers.dev/
Date,EUR,JPY,GBP,CHF,1/EUR,1/JPY,1/GBP,1/CHF
2007-11-08,1.4666,0.008840265220012,2.10642728904847,0.883440756580929,0.681849174962498,113.118778126279,0.47473748806764,1.13193781535524

Builtin SQLite functions along with extra features are avaialble.

$ curl -XPOST --data \
"
SELECT
  getdata('country') AS country,
  random() AS rnd,
  date('now') AS now
" \
-H 'content-type: application/text' \
https://sql.lspgn.workers.dev/
country,rnd,now
US,-7348224717915799868,2021-01-18
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].