SQLite is a small, fast, self-contained SQL Database engine. AOS is the AO System in WebAssembly and uses Lua. The combination provides you with the ability to add lightweight and powerful indexers to AO. More indexers are planned for the future but the AOS Sqlite Module is available now.
GYrbbe0VbHim_7Hi6zrOpHQXrSQz07XNtwCnfbFo2I0
is the current AO Module Identifier.
I am Tom Wilson (Rakis) online, and I am the lead Developer of AOS and AO. I have also developed and published several other projects on Arweave and the Permaweb, from PermaNotes, Permapages, Stamp Protocol, Now, Specs, Permaweb Cookbook, Universal Content Management Protocol, and more. I am passionate about the Permaweb. The current internet is not the cyberspace I envison, and think the Permaweb, ao, and Arweave give us hope to create a cyperspace that helps humanity move forward.
You should be knowledgable in computer science and know your way around a terminal. Familiar with Arweave Wallets, AOS and the AOS Console is a plus. To learn more about AOS checkout the cookbook. https://cookbook_ao.g8way.io
In this presentation, we will focus on AOS Handlers and Sqlite. In order to showcase this functionality we will build the backend of a DevChat Chatroom Process
NOTE: this is a demo showing the features of AOS and Sqlite and not a guide for best practices.
We will start with the AOS Console installed, and in the terminal. If you do not have AOS Console installed, please see the cookbook.
Let's create a new aos project.
I am using a template I created called test-kit, this template gives me the ability to run integration tests locally so I can better manage my AOS process code.
We also want to add a package called DbAdmin
it gives us some helper methods for AOS-SQLite.
We will be testing our sqlite process with the following command. At this point all tests should pass.
Lets make sure our DbAdmin Package gets loaded into our test suite.
test/main.test.js
Lets change our load source test to be the following:
And update our src/main.lua
to return "OK"
Test
Create Tables
TDD -> Testing…
In this workshop, we will use TDD to provide us with happy path tests to
verify our code is working, then we will publish a process and manually test.
We are going to implement three Handlers:
Lets write a test:
Lets write a Handler:
Test
Handler
Spawning our Process
Lets Register
With the AOS-SQLite module it is easy to add powerful indexeers to your AO Processes. You have the full power of a SQL Database available with a very small footprint.