source: code/trunk/vendor/modernc.org/sqlite/sqlite_go18.go@ 822

Last change on this file since 822 was 822, checked in by yakumo.izuru, 22 months ago

Prefer immortal.run over runit and rc.d, use vendored modules
for convenience.

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File size: 1.5 KB
Line 
1// Copyright 2017 The Sqlite Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5//go:build go1.8
6// +build go1.8
7
8package sqlite // import "modernc.org/sqlite"
9
10import (
11 "context"
12 "database/sql/driver"
13)
14
15// Ping implements driver.Pinger
16func (c *conn) Ping(ctx context.Context) error {
17 _, err := c.ExecContext(ctx, "select 1", nil)
18 return err
19}
20
21// BeginTx implements driver.ConnBeginTx
22func (c *conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) {
23 return c.begin(ctx, opts)
24}
25
26// PrepareContext implements driver.ConnPrepareContext
27func (c *conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error) {
28 return c.prepare(ctx, query)
29}
30
31// ExecContext implements driver.ExecerContext
32func (c *conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) {
33 return c.exec(ctx, query, args)
34}
35
36// QueryContext implements driver.QueryerContext
37func (c *conn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error) {
38 return c.query(ctx, query, args)
39}
40
41// ExecContext implements driver.StmtExecContext
42func (s *stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error) {
43 return s.exec(ctx, args)
44}
45
46// QueryContext implements driver.StmtQueryContext
47func (s *stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) {
48 return s.query(ctx, args)
49}
Note: See TracBrowser for help on using the repository browser.