GithubHelp home page GithubHelp logo

waldmatias / aos-sqlite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from permaweb/aos-sqlite

0.0 0.0 0.0 9.84 MB

AOS Module built with LUA and SQLite

Shell 0.01% JavaScript 0.02% Python 0.15% C 99.57% Lua 0.21% Makefile 0.01% Dockerfile 0.04%

aos-sqlite's Introduction

AOS-SQLite

AOS-SQLite combines the ao operating system module and sqlite to create an ao custom module to add a lightweight but powerful indexer to your aos experience.

The bulk of this effort was done by @elliotsayes during the Hack the Weave competition, Elliot was able to create this WASM Binary that includes both SQLite, LUA, and aos, as an ao Module.

AOS-SQLite Module - z9iaKddl-rIBinPG7_3-oLAdgIujPPPCbUul5mBSIOk

Run a SQLite Database with AOS(WASM64)

aos my-sqlite --module=z9iaKddl-rIBinPG7_3-oLAdgIujPPPCbUul5mBSIOk

Run a SQLite Database with AOS(WASM32)

aos my-sqlite --module=GYrbbe0VbHim_7Hi6zrOpHQXrSQz07XNtwCnfbFo2I0

Spawn via a process

Spawn('z9iaKddl-rIBinPG7_3-oLAdgIujPPPCbUul5mBSIOk', { Data = "Hello SQLite Wasm64" })

Examples

local sqlite3 = require("lsqlite3")
 
db = sqlite3.open_memory()
  
db:exec[[
  CREATE TABLE test (id INTEGER PRIMARY KEY, content);
  INSERT INTO test VALUES (NULL, 'Hello Lua');
  INSERT INTO test VALUES (NULL, 'Hello Sqlite3');
  INSERT INTO test VALUES (NULL, 'Hello ao!!!');
]]
return "ok"
local s = ""
 
for row in db:nrows("SELECT * FROM test") do
  s = s .. row.id .. ": " .. row.content .. "\\n"
end
 
return s

AO Resources


This project builds the AOS-SQLITE WASM Binary and Publishes it to Arweave.

Build Process

  1. Build docker image
cd container
./build.sh
  1. Get Latest aos module
git submodule init
git submodule update --remote
  1. Use docker image to compile process.wasm
cd aos/process
docker run -v .:/src p3rmaw3b/ao emcc-lua
  1. Publish Module with tags via arkb

You will need a funded wallet for this step

export WALLET=~/.wallet.json
npm run deploy

aos-sqlite's People

Contributors

smowden avatar twilson63 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.