Skip to content

Autonomous-Finance/aos-sqlite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 - ij7nvQ5XnAqqzEy-8vVz6GxSyb5HYZJ2SMtwDIUVMQY

Run a SQLite Database with AOS

AOS_MODULE=ij7nvQ5XnAqqzEy-8vVz6GxSyb5HYZJ2SMtwDIUVMQY aos my-sqlite

Spawn via a process

Spawn('ij7nvQ5XnAqqzEy-8vVz6GxSyb5HYZJ2SMtwDIUVMQY', {})

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

About

AOS Module built with LUA and SQLite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 99.7%
  • Other 0.3%