storage: begin implementing sqlite3 storage

This commit is contained in:
George Tankersley
2018-11-18 03:02:49 +00:00
parent 7cc7095a81
commit 0dee0b425e
9 changed files with 158 additions and 3 deletions

17
storage/sqlite3.go Normal file
View File

@@ -0,0 +1,17 @@
package storage
import "database/sql"
func createBlockTable(conn *sql.DB) error {
tableCreation := `
CREATE TABLE IF NOT EXISTS blocks (
height INTEGER,
hash TEXT,
has_sapling_tx BOOL,
compact_encoding BLOB,
PRIMARY KEY (height, hash)
);
`
_, err := conn.Exec(tableCreation)
return err
}