immedb

package module
v0.0.0-...-99b0398 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright 2020 ImmeDB Authors

Licensed 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 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 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 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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func (*Conn) Begin

func (c *Conn) Begin() (driver.Tx, error)

func (*Conn) Close

func (c *Conn) Close() error

Close invalidates and potentially stops any current prepared statements and transactions, marking this connection as no longer in use.

Because the sql package maintains a free pool of connections and only calls Close when there's a surplus of idle connections, it shouldn't be necessary for drivers to do their own connection caching.

Drivers must ensure all network calls made by Close do not block indefinitely (e.g. apply a timeout).

func (*Conn) Exec

func (c *Conn) Exec(query string, args []driver.Value) (driver.Result, error)

func (*Conn) Prepare

func (c *Conn) Prepare(query string) (driver.Stmt, error)

func (*Conn) Query

func (c *Conn) Query(query string, args []driver.Value) (driver.Rows, error)

type Driver

type Driver struct {
	// Mutex protect the map of Kit
	sync.Mutex
	// contains filtered or unexported fields
}

Driver is the driver entrypoint, implementing database/sql/driver interface

func (*Driver) Open

func (rs *Driver) Open(dsn string) (conn driver.Conn, err error)

Open return an active connection so RamSQL server If there is no connection in pool, start a new server. After first instantiation of the server,

type Result

type Result struct {
	// contains filtered or unexported fields
}

Result is the result of a query execution.

func (*Result) LastInsertId

func (r *Result) LastInsertId() (int64, error)

LastInsertId returns the database's auto-generated ID after, for example, an INSERT into a table with primary key.

func (*Result) RowsAffected

func (r *Result) RowsAffected() (int64, error)

RowsAffected returns the number of rows affected by the query.

type Rows

type Rows struct {
	// contains filtered or unexported fields
}

Rows is an iterator over an executed query's results.

func (*Rows) Close

func (r *Rows) Close() error

Close closes the rows iterator.

func (*Rows) Columns

func (r *Rows) Columns() []string

Columns returns the names of the columns. The number of columns of the result is inferred from the length of the slice. If a particular column name isn't known, an empty string should be returned for that entry.

func (*Rows) Next

func (r *Rows) Next(dest []driver.Value) error

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
}

Stmt is a prepared statement. It is bound to a Conn and not used by multiple goroutines concurrently.

func (*Stmt) Close

func (s *Stmt) Close() error

Close closes the statement.

As of Go 1.1, a Stmt will not be closed if it's in use by any queries.

Drivers must ensure all network calls made by Close do not block indefinitely (e.g. apply a timeout).

func (*Stmt) Exec deprecated

func (s *Stmt) Exec(args []driver.Value) (driver.Result, error)

Exec executes a query that doesn't return rows, such as an INSERT or UPDATE.

Deprecated: Drivers should implement StmtExecContext instead (or additionally).

func (*Stmt) NumInput

func (s *Stmt) NumInput() int

NumInput returns the number of placeholder parameters.

If NumInput returns >= 0, the sql package will sanity check argument counts from callers and return errors to the caller before the statement's Exec or Query methods are called.

NumInput may also return -1, if the driver doesn't know its number of placeholders. In that case, the sql package will not sanity check Exec or Query argument counts.

func (*Stmt) Query deprecated

func (s *Stmt) Query(args []driver.Value) (r driver.Rows, err error)

Query executes a query that may return rows, such as a SELECT.

Deprecated: Drivers should implement StmtQueryContext instead (or additionally).

type Tx

type Tx struct {
}

Tx implements SQL transaction method

func (*Tx) Commit

func (t *Tx) Commit() error

Commit the transaction on server

func (*Tx) Rollback

func (t *Tx) Rollback() error

Rollback all changes

Jump to

Keyboard shortcuts

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