Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import (
- "database/sql"
- _ "github.com/mattn/go-sqlite3"
- )
- func ConnectToDB(file string, schema string) error {
- db, err := sql.Open("sqlite3", file)
- if err != nil {
- return err
- }
- if _, err = db.Exec("PRAGMA foreign_keys = ON"); err != nil {
- return err
- }
- return nil
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement