Documentation ¶
Overview ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func GetTLSConfig(name string) (*tls.Config, bool)
- func RegisterTLSConfig(name string, cfg *tls.Config) error
- func UnregisterTLSConfig(name string) error
- type Connection
- func (c *Connection) Begin() (driver.Tx, error)
- func (c *Connection) BeginTx(ctx context.Context, opts sql.TxOptions) (driver.Tx, error)
- func (c *Connection) Close() error
- func (c *Connection) Prepare(query string) (driver.Stmt, error)
- func (c *Connection) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- func (c *Connection) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
- type Connector
- type Driver
- type DriverConfig
- type Result
- type Rows
- type Stmt
- func (s *Stmt) Close() error
- func (s *Stmt) Exec(args []driver.Value) (driver.Result, error)
- func (s *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
- func (s *Stmt) NumInput() int
- func (s *Stmt) Query(args []driver.Value) (driver.Rows, error)
- func (s *Stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
- type Tx
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotSupported = errors.New("not supported") ErrOutOfRange = errors.New("index out of range") ErrTransactionInProgress = errors.New("transaction still in progress") ErrRegistryEntryExists = errors.New("entry already exists") ErrRegistryNoEntry = errors.New("entry not registered") )
Functions ¶
func UnregisterTLSConfig ¶
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Begin ¶
func (c *Connection) Begin() (driver.Tx, error)
Begin starts and returns a new transaction.
func (*Connection) Close ¶
func (c *Connection) Close() error
Close invalidates and potentially stops any current prepared statements and transactions, marking this connection as no longer in use.
func (*Connection) Prepare ¶
func (c *Connection) Prepare(query string) (driver.Stmt, error)
Prepare returns a prepared statement, bound to this connection.
func (*Connection) PrepareContext ¶
PrepareContext returns a prepared statement, bound to this connection. context is for the preparation of the statement, it must not store the context within the statement itself.
func (*Connection) QueryContext ¶
func (c *Connection) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func (*Connector) Configure ¶
func (c *Connector) Configure(config *DriverConfig) error
Configure the driver with the corresponding config
type Driver ¶
type Driver struct{}
type DriverConfig ¶
type DriverConfig struct { Address string Username string Password string Token string Timeout time.Duration Params map[string]string TLSEnabled bool TLSConfigName string TLSConfig *tls.Config }
func NewDriverConfigFromDSN ¶
func NewDriverConfigFromDSN(dsn string) (*DriverConfig, error)
func (*DriverConfig) DSN ¶
func (config *DriverConfig) DSN() string
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) LastInsertId ¶
LastInsertId returns the database's auto-generated ID after, for example, an INSERT into a table with primary key.
func (*Result) RowsAffected ¶
RowsAffected returns the number of rows affected by the query.
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
func (*Rows) Next ¶
Next is called to populate the next row of data into the provided slice. The provided slice will be the same size as the Columns() are wide.
Next should return io.EOF when there are no more rows.
The dest should not be written to outside of Next. Care should be taken when closing Rows not to modify a buffer held in dest.
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
func (*Stmt) ExecContext ¶
ExecContext executes a query that doesn't return rows, such as an INSERT or UPDATE.
func (*Stmt) QueryContext ¶
QueryContext executes a query that may return rows, such as a SELECT.