aerospike

package module
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 31 Imported by: 2

README

Datastore Connectivity for Aerospike(aerospike)

Aerospike database/sql driver GoDoc

This library is compatible with Go 1.17+

Please refer to CHANGELOG.md if you encounter breaking changes.

Usage:

The following is a very simple example of CRUD operations

package main

import (
	"database/sql"
	"log"
	_ "github.com/viant/aerospike"
)

type Participant struct {
	Name   string
	Splits []float64
}

func main() {

	db, err := sql.Open("aerospike", "aerospike://<IP>/namespace")
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()
	

License

The source code is made available under the terms of the Apache License, Version 2, as stated in the file LICENSE.

Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.

Credits and Acknowledgements

Library Author:

Contributors:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsKeyNotFound

func IsKeyNotFound(err error) bool

IsKeyNotFound returns true if mapKey not found error.

func RegisterSet

func RegisterSet(xType *x.Type) error

RegisterSet register set

Types

type Config

type Config struct {
	ClientPolicy *as.ClientPolicy

	url.Values
	// contains filtered or unexported fields
}

Config represent Connection config

func ParseDSN

func ParseDSN(dsn string) (*Config, error)

type Driver

type Driver struct{}

Driver is exported to make the driver directly accessible. In general the driver is used via the database/sql package.

func (Driver) Open

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

Open new Connection. See https://github.com/viant/aerospike#dsn-data-source-name for how the DSN string is formatted

type Rows

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

func (*Rows) Close

func (r *Rows) Close() error

Close closes rows

func (*Rows) ColumnTypeDatabaseTypeName

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

ColumnTypeDatabaseTypeName returns column database type name

func (*Rows) ColumnTypeNullable

func (r *Rows) ColumnTypeNullable(index int) (nullable, ok bool)

ColumnTypeNullable returns if column is nullable

func (*Rows) ColumnTypeScanType

func (r *Rows) ColumnTypeScanType(index int) reflect.Type

ColumnTypeScanType returns column scan type

func (*Rows) Columns

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

Columns returns parameterizedQuery columns

func (*Rows) Next

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

Next moves to next row

type RowsReader

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

func (*RowsReader) Read

func (r *RowsReader) Read(ctx context.Context) (record *as.Record, err error)

type RowsScanReader

type RowsScanReader struct {
	*as.Recordset
}

func (*RowsScanReader) Read

func (r *RowsScanReader) Read(ctx context.Context) (*as.Record, error)

type Statement

type Statement struct {

	//BaseURL    string
	SQL string
	// contains filtered or unexported fields
}

Statement abstraction implements database/sql driver.Statement interface

func (*Statement) CheckNamedValue

func (s *Statement) CheckNamedValue(named *driver.NamedValue) error

CheckNamedValue checks supported globalTypes (all for now)

func (*Statement) Close

func (s *Statement) Close() error

func (*Statement) Exec

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

Exec executes statements

func (*Statement) ExecContext

func (s *Statement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)

ExecContext executes statements

func (*Statement) NumInput

func (s *Statement) NumInput() int

NumInput returns numinput

func (*Statement) Query

func (s *Statement) Query(args []driver.Value) (driver.Rows, error)

Query runs parameterizedQuery

func (*Statement) QueryContext

func (s *Statement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)

QueryContext runs parameterizedQuery

type Tag

type Tag struct {
	Name             string
	IsPK             bool
	IsMapKey         bool
	IsSecondaryIndex bool
	IsArrayIndex     bool
	Ignore           bool
	UnixSec          bool
	ArraySize        int
	IsComponent      bool
}

func ParseTag

func ParseTag(tagString string) (*Tag, error)

Jump to

Keyboard shortcuts

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