master
go 63 lines 1.45 KB
Raw
1 //go:build !cgo
2
3 // SPDX-License-Identifier: GPL-3.0-or-later
4
5 package odbcbridge
6
7 import (
8 "context"
9 "database/sql/driver"
10 "errors"
11 )
12
13 // Stub implementation for when CGO is disabled
14
15 type OptimizedConnection struct{}
16
17 func ConnectOptimized(dsn string) (*OptimizedConnection, error) {
18 return nil, errors.New("ODBC bridge requires CGO support")
19 }
20
21 func (c *OptimizedConnection) PrepareContext(ctx context.Context, query string) (*PreparedStatement, error) {
22 return nil, errors.New("ODBC bridge requires CGO support")
23 }
24
25 func (c *OptimizedConnection) QueryContext(ctx context.Context, query string) (*OptimizedRows, error) {
26 return nil, errors.New("ODBC bridge requires CGO support")
27 }
28
29 func (c *OptimizedConnection) Close() error {
30 return errors.New("ODBC bridge requires CGO support")
31 }
32
33 func (c *OptimizedConnection) IsConnected() bool {
34 return false
35 }
36
37 type PreparedStatement struct{}
38
39 func (s *PreparedStatement) Execute() (*OptimizedRows, error) {
40 return nil, errors.New("ODBC bridge requires CGO support")
41 }
42
43 func (s *PreparedStatement) Close() error {
44 return errors.New("ODBC bridge requires CGO support")
45 }
46
47 type OptimizedRows struct{}
48
49 func (r *OptimizedRows) Columns() []string {
50 return nil
51 }
52
53 func (r *OptimizedRows) Close() error {
54 return errors.New("ODBC bridge requires CGO support")
55 }
56
57 func (r *OptimizedRows) Next(dest []driver.Value) error {
58 return errors.New("ODBC bridge requires CGO support")
59 }
60
61 func (r *OptimizedRows) RowCount() int64 {
62 return 0
63 }