driver

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 9 Imported by: 0

README

About

This a simple Go database\sql driver for Redis.

How to use

$ go get github.com/bonede/go-redis-driver
// main.go
package main

import (
	"database/sql"
	_ "github.com/bonede/go-redis-driver"
)
func main(){
    db, err := sql.Open("redis", "<user>:<pass>@localhost:6379/<db>")
    defer db.Close()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisConn

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

func (*RedisConn) Begin

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

func (*RedisConn) BeginTx

func (c *RedisConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)

func (*RedisConn) Close

func (c *RedisConn) Close() error

func (*RedisConn) ExecContext

func (c *RedisConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)

func (*RedisConn) Ping

func (c *RedisConn) Ping(ctx context.Context) error

func (*RedisConn) Prepare

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

func (*RedisConn) QueryContext

func (c *RedisConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)

type RedisDriver

type RedisDriver struct {
}

func (*RedisDriver) Open

func (d *RedisDriver) Open(dsn string) (driver.Conn, error)

type RedisResult

type RedisResult struct {
}

func (*RedisResult) LastInsertId

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

func (*RedisResult) RowsAffected

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

type RedisRows

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

func (*RedisRows) Close

func (r *RedisRows) Close() error

func (*RedisRows) ColumnTypeDatabaseTypeName

func (r *RedisRows) ColumnTypeDatabaseTypeName(index int) string

func (*RedisRows) Columns

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

func (*RedisRows) Next

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

func (*RedisRows) RowsColumnTypeLength

func (r *RedisRows) RowsColumnTypeLength(index int) (length int64, ok bool)

func (*RedisRows) RowsColumnTypeScanType

func (r *RedisRows) RowsColumnTypeScanType(index int) reflect.Type

type RedisTx

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

func (*RedisTx) Commit

func (t *RedisTx) Commit() error

func (*RedisTx) Rollback

func (t *RedisTx) Rollback() error

Jump to

Keyboard shortcuts

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