driver

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2016 License: BSD-3-Clause, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package driver registers a QL sql/driver named "ql" and a memory driver named "ql-mem".

See also [0], [1] and [3].

Usage

A skeleton program using ql/driver.

package main

import (
	"database/sql"

	_ "github.com/cznic/ql/driver"
)

func main() {
	...
	// Disk file DB
	db, err := sql.Open("ql", "ql.db")  // [2]
	// alternatively
	db, err := sql.Open("ql", "file://ql.db")

	// and/or

	// RAM DB
	mdb, err := sql.Open("ql-mem", "mem.db")
	// alternatively
	mdb, err := sql.Open("ql", "memory://mem.db")
	if err != nil {
		log.Fatal(err)
	}

	// Use db/mdb here
	...
}

This package exports nothing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL