master
go 37 lines 936 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 //go:build !cgo
4
5 package db2
6
7 import (
8 "context"
9 "database/sql"
10 "errors"
11 )
12
13 type Config struct{}
14
15 type Client struct{}
16
17 func NewClient(Config) *Client { return &Client{} }
18
19 func (c *Client) Connect(context.Context) error { return errors.New("db2 protocol requires CGO") }
20
21 func (c *Client) Ping(context.Context) error { return errors.New("db2 protocol requires CGO") }
22
23 func (c *Client) Close() error { return nil }
24
25 func (c *Client) DoQuery(context.Context, string, func(string, string, bool)) error {
26 return errors.New("db2 protocol requires CGO")
27 }
28
29 func (c *Client) DoQueryRow(context.Context, string, func(string, string)) error {
30 return errors.New("db2 protocol requires CGO")
31 }
32
33 func (c *Client) QueryRows(context.Context, string) (*sql.Rows, context.CancelFunc, error) {
34 return nil, nil, errors.New("db2 protocol requires CGO")
35 }
36
37 func (c *Client) DB() *sql.DB { return nil }