occlum/demos/golang/go_sqlite
2021-04-16 09:34:26 +08:00
..
.gitignore Add Golang SQLite demo 2020-09-27 14:21:58 +08:00
README.md Add Golang SQLite demo 2020-09-27 14:21:58 +08:00
run_go_sqlite_demo.sh Update golang version to 1.16.3 2021-04-16 09:34:26 +08:00
simple_demo.go Add Golang SQLite demo 2020-09-27 14:21:58 +08:00

Use Golang and SQLite with Occlum

This project demonstrates how Occlum enables Golang programs with SQLite library calls running in SGX enclaves. The way to use a SQL (or SQL-like) database in Go is through the database/sql package. The SQL package exposes an ideal set of generic APIs for a variety of SQL or SQL-like databases. The SQL package itself must be used in conjunction with a database driver package.

The demo program is based on a widely used sqlite3 driver conforming to the built-in database/sql interface and passing the compatibility test suite at https://github.com/bradfitz/go-sql-test. You can run the Golang SQLite demo on Occlum via

./run_go_sqlite_demo.sh

The demo program adds a database source file golang_sql_driver.db, creates a table SqlDrivers, inserts a list of Golang SQL database driver records, queries all records, and prints them out.