occlum/demos/golang/go_sqlite
Lan Yun fbff05bddb Update the Golang version to 1.18.4 and use it as the default one.
Signed-off-by: Lan Yun <yun.lan@intel.com>
2022-08-08 12:18:33 +08:00
..
.gitignore Add Golang SQLite demo 2020-09-27 14:21:58 +08:00
go_sqlite.yaml Update go_sqlite demo with bom file 2021-09-26 16:34:52 +08:00
README.md Add Golang SQLite demo 2020-09-27 14:21:58 +08:00
run_go_sqlite_demo.sh Update the Golang version to 1.18.4 and use it as the default one. 2022-08-08 12:18:33 +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.