README

Go Report Card

Go driver for Siodb

A simple driver for Siodb written in pure Go.

Features

  • Support of URI
  • Connections to Siodb (TLS, TCP, Unix socket)
  • Authentication to Siodb
  • Query execution
  • DML execution

Quick start

Docker
# Pull the latest container of Siodb
docker run -p 127.0.0.1:50000:50000/tcp --name siodb siodb/siodb
# Get a copy of the private key of the Siodb root user
docker exec -it siodb cat /home/siodb/.ssh/id_rsa > ~/root_id_rsa
Cloud

Deploy to Hidora

Free Trial. Requires only an email address.

Driver installation

Get the driver into you Go project:

go get -u https://github.com/siodb/siodb-go-driver

You're ready to Go!

Example

Import
package main

import (
    "context"
    "database/sql"
    _ "bitbucket.org/siodb-squad/siodb-go-driver"
)
Siodb Connection
    db, err := sql.Open("siodb", "siodbs://root@localhost:50000?identity_file=/home/nico/root_id_rsa")
    if err != nil {
        t.Fatalf("Error occurred %s", err.Error())
    }
    defer db.Close()

    ctx, stop := context.WithCancel(context.Background())
    defer stop()

    if err := db.PingContext(ctx); err != nil {
        t.Fatalf("Error occurred %s", err.Error())
    }
DDL
    var name string
    err = db.QueryRowContext(ctx, "select name from test.sys_tables where name = 'TABLEALLDATATYPES'").Scan(&name)
    switch {
    case err == sql.ErrNoRows:
        if _, err := db.ExecContext(ctx,
            `CREATE TABLE test.tablealldatatypes
                                    (
                                        ctinyintmin  TINYINT,
                                        ctinyintmax  TINYINT,
                                        ctinyuint    TINYUINT,
                                        csmallintmin SMALLINT,
                                        csmallintmax SMALLINT,
                                        csmalluint   SMALLUINT,
                                        cintmin      INT,
                                        cintmax      INT,
                                        cuint        UINT,
                                        cbigintmin   BIGINT,
                                        cbigintmax   BIGINT,
                                        cbiguint     BIGUINT,
                                        cfloatmin    FLOAT,
                                        cfloatmax    FLOAT,
                                        cdoublemin   DOUBLE,
                                        cdoublemax   DOUBLE,
                                        ctext        TEXT,
                                        cts          TIMESTAMP
                                    )
                                    `); err != nil {
            t.Fatalf("Error occurred: %s", err.Error())
        }
    case err != nil:
        t.Fatalf("Error occurred: %s", err.Error())
    case err == nil:
        break
    default:
        t.Fatalf("Error occurred: %s", err.Error())
    }
DML
    if _, err := db.ExecContext(ctx,
        `INSERT INTO test.tablealldatatypes
                                VALUES  ( -128,
                                          127,
                                          255,
                                          -32768,
                                          32767,
                                          65535,
                                          -2147483648,
                                          2147483647,
                                          4294967295,
                                          -9223372036854775808,
                                          9223372036854775807,
                                          18446744073709551615,
                                          222.222,
                                          222.222,
                                          222.222,
                                          222.222,
                                          '汉字',
                                          CURRENT_TIMESTAMP )`,
    ); err != nil {
        log.Fatal("An Error occurred: ", err)
    }
Query
    rows, err := db.QueryContext(ctx, "SELECT trid, cbigintmin, ctext, cts FROM test.tablealldatatypes")
    if err != nil {
        log.Fatal(err)
    }
    defer rows.Close()

    var Trid uint64
    var AnyValue interface{}
    var StringValue string
    var TiemstampValue time.Time

    for rows.Next() {
        if err := rows.Scan(&Trid, &AnyValue, &StringValue, &TiemstampValue); err != nil {
            log.Fatal(err)
        }
        fmt.Println(fmt.Sprintf("Row: %v | %v | %v | %v ", Trid, AnyValue, StringValue, TiemstampValue))
    }
    if err := rows.Err(); err != nil {
        log.Fatal(err)
    }

URI

To identify a Siodb resource, the driver use the URI format.

For TLS connection (default):

siodbs://root@localhost:50000?identity_file=/home/siodb/.ssh/id_rsa

For TCP plain text connection:

siodb://root@localhost:50000?identity_file=/home/siodb/.ssh/id_rsa

For Unix socket connection:

siodbu://root@/run/siodb/siodb.socket?identity_file=/home/siodb/.ssh/id_rsa

The above examples will connect you to the localhost with port number 50000. The driver will do the authentication with the Siodb user root and the identity file /home/siodb/.ssh/id_rsa.

Options
  • identity_file: the path to the RSA private key.
  • trace: to trace everything within the driver to sdtout.

Support Siodb

Do you like this project? Tell it by clicking the star 🟊 on the top right of this page ☝☝

Documentation

We write the Siodb documentation in Markdow and it is available in the folder docs/users/docs. If you prefer a more user friendly format, the same documentation is available online here.

Contribution

Please refer to the Contributing file.

Support

  • Report your issue with Siodb 👉 here.
  • Report your issue with the driver 👉 here.
  • Ask a question 👉 here.
  • Siodb Slack space 👉 here.

Follow Siodb

License

Licensed under Apache License version 2.0.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColumnDataType_name = map[int32]string{
	0:   "COLUMN_DATA_TYPE_BOOL",
	1:   "COLUMN_DATA_TYPE_INT8",
	2:   "COLUMN_DATA_TYPE_UINT8",
	3:   "COLUMN_DATA_TYPE_INT16",
	4:   "COLUMN_DATA_TYPE_UINT16",
	5:   "COLUMN_DATA_TYPE_INT32",
	6:   "COLUMN_DATA_TYPE_UINT32",
	7:   "COLUMN_DATA_TYPE_INT64",
	8:   "COLUMN_DATA_TYPE_UINT64",
	9:   "COLUMN_DATA_TYPE_FLOAT",
	10:  "COLUMN_DATA_TYPE_DOUBLE",
	11:  "COLUMN_DATA_TYPE_TEXT",
	12:  "COLUMN_DATA_TYPE_NTEXT",
	13:  "COLUMN_DATA_TYPE_BINARY",
	14:  "COLUMN_DATA_TYPE_DATE",
	15:  "COLUMN_DATA_TYPE_TIME",
	16:  "COLUMN_DATA_TYPE_TIME_WITH_TZ",
	17:  "COLUMN_DATA_TYPE_TIMESTAMP",
	18:  "COLUMN_DATA_TYPE_TIMESTAMP_WITH_TZ",
	19:  "COLUMN_DATA_TYPE_DATE_INTERVAL",
	20:  "COLUMN_DATA_TYPE_TIME_INTERVAL",
	21:  "COLUMN_DATA_TYPE_STRUCT",
	22:  "COLUMN_DATA_TYPE_XML",
	23:  "COLUMN_DATA_TYPE_JSON",
	24:  "COLUMN_DATA_TYPE_UUID",
	25:  "COLUMN_DATA_TYPE_MAX",
	127: "COLUMN_DATA_TYPE_UNKNOWN",
}
View Source
var ColumnDataType_value = map[string]int32{
	"COLUMN_DATA_TYPE_BOOL":              0,
	"COLUMN_DATA_TYPE_INT8":              1,
	"COLUMN_DATA_TYPE_UINT8":             2,
	"COLUMN_DATA_TYPE_INT16":             3,
	"COLUMN_DATA_TYPE_UINT16":            4,
	"COLUMN_DATA_TYPE_INT32":             5,
	"COLUMN_DATA_TYPE_UINT32":            6,
	"COLUMN_DATA_TYPE_INT64":             7,
	"COLUMN_DATA_TYPE_UINT64":            8,
	"COLUMN_DATA_TYPE_FLOAT":             9,
	"COLUMN_DATA_TYPE_DOUBLE":            10,
	"COLUMN_DATA_TYPE_TEXT":              11,
	"COLUMN_DATA_TYPE_NTEXT":             12,
	"COLUMN_DATA_TYPE_BINARY":            13,
	"COLUMN_DATA_TYPE_DATE":              14,
	"COLUMN_DATA_TYPE_TIME":              15,
	"COLUMN_DATA_TYPE_TIME_WITH_TZ":      16,
	"COLUMN_DATA_TYPE_TIMESTAMP":         17,
	"COLUMN_DATA_TYPE_TIMESTAMP_WITH_TZ": 18,
	"COLUMN_DATA_TYPE_DATE_INTERVAL":     19,
	"COLUMN_DATA_TYPE_TIME_INTERVAL":     20,
	"COLUMN_DATA_TYPE_STRUCT":            21,
	"COLUMN_DATA_TYPE_XML":               22,
	"COLUMN_DATA_TYPE_JSON":              23,
	"COLUMN_DATA_TYPE_UUID":              24,
	"COLUMN_DATA_TYPE_MAX":               25,
	"COLUMN_DATA_TYPE_UNKNOWN":           127,
}

Functions

Types

type AttributeDescription

type AttributeDescription struct {
	//* Column name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	//* Column type.
	Type ColumnDataType `protobuf:"varint,2,opt,name=type,proto3,enum=siodb.ColumnDataType" json:"type,omitempty"`
	//* Column can have null values.
	IsNull bool `protobuf:"varint,3,opt,name=is_null,json=isNull,proto3" json:"is_null,omitempty"`
	//* Attributes of a structured data type
	Attribute            []*AttributeDescription `protobuf:"bytes,4,rep,name=attribute,proto3" json:"attribute,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

* Structured column data type attribute description

func (*AttributeDescription) Descriptor

func (*AttributeDescription) Descriptor() ([]byte, []int)

func (*AttributeDescription) GetAttribute

func (m *AttributeDescription) GetAttribute() []*AttributeDescription

func (*AttributeDescription) GetIsNull

func (m *AttributeDescription) GetIsNull() bool

func (*AttributeDescription) GetName

func (m *AttributeDescription) GetName() string

func (*AttributeDescription) GetType

func (m *AttributeDescription) GetType() ColumnDataType

func (*AttributeDescription) ProtoMessage

func (*AttributeDescription) ProtoMessage()

func (*AttributeDescription) Reset

func (m *AttributeDescription) Reset()

func (*AttributeDescription) String

func (m *AttributeDescription) String() string

func (*AttributeDescription) XXX_DiscardUnknown

func (m *AttributeDescription) XXX_DiscardUnknown()

func (*AttributeDescription) XXX_Marshal

func (m *AttributeDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AttributeDescription) XXX_Merge

func (m *AttributeDescription) XXX_Merge(src proto.Message)

func (*AttributeDescription) XXX_Size

func (m *AttributeDescription) XXX_Size() int

func (*AttributeDescription) XXX_Unmarshal

func (m *AttributeDescription) XXX_Unmarshal(b []byte) error

type BeginSessionRequest

type BeginSessionRequest struct {
	//* User name
	UserName             string   `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* Begin session request

func (*BeginSessionRequest) Descriptor

func (*BeginSessionRequest) Descriptor() ([]byte, []int)

func (*BeginSessionRequest) GetUserName

func (m *BeginSessionRequest) GetUserName() string

func (*BeginSessionRequest) ProtoMessage

func (*BeginSessionRequest) ProtoMessage()

func (*BeginSessionRequest) Reset

func (m *BeginSessionRequest) Reset()

func (*BeginSessionRequest) String

func (m *BeginSessionRequest) String() string

func (*BeginSessionRequest) XXX_DiscardUnknown

func (m *BeginSessionRequest) XXX_DiscardUnknown()

func (*BeginSessionRequest) XXX_Marshal

func (m *BeginSessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BeginSessionRequest) XXX_Merge

func (m *BeginSessionRequest) XXX_Merge(src proto.Message)

func (*BeginSessionRequest) XXX_Size

func (m *BeginSessionRequest) XXX_Size() int

func (*BeginSessionRequest) XXX_Unmarshal

func (m *BeginSessionRequest) XXX_Unmarshal(b []byte) error

type BeginSessionResponse

type BeginSessionResponse struct {
	//* Indication that session is started.
	SessionStarted bool `protobuf:"varint,1,opt,name=session_started,json=sessionStarted,proto3" json:"session_started,omitempty"`
	//* Message from IO manager. Set in case of error(session_started = false).
	Message *StatusMessage `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	//* Challenge. Sent only in case if session is started.
	Challenge            []byte   `protobuf:"bytes,3,opt,name=challenge,proto3" json:"challenge,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* Begin session response.

func (*BeginSessionResponse) Descriptor

func (*BeginSessionResponse) Descriptor() ([]byte, []int)

func (*BeginSessionResponse) GetChallenge

func (m *BeginSessionResponse) GetChallenge() []byte

func (*BeginSessionResponse) GetMessage

func (m *BeginSessionResponse) GetMessage() *StatusMessage

func (*BeginSessionResponse) GetSessionStarted

func (m *BeginSessionResponse) GetSessionStarted() bool

func (*BeginSessionResponse) ProtoMessage

func (*BeginSessionResponse) ProtoMessage()

func (*BeginSessionResponse) Reset

func (m *BeginSessionResponse) Reset()

func (*BeginSessionResponse) String

func (m *BeginSessionResponse) String() string

func (*BeginSessionResponse) XXX_DiscardUnknown

func (m *BeginSessionResponse) XXX_DiscardUnknown()

func (*BeginSessionResponse) XXX_Marshal

func (m *BeginSessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BeginSessionResponse) XXX_Merge

func (m *BeginSessionResponse) XXX_Merge(src proto.Message)

func (*BeginSessionResponse) XXX_Size

func (m *BeginSessionResponse) XXX_Size() int

func (*BeginSessionResponse) XXX_Unmarshal

func (m *BeginSessionResponse) XXX_Unmarshal(b []byte) error

type ClientAuthenticationRequest

type ClientAuthenticationRequest struct {
	//* User message signature.
	Signature            []byte   `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* User authentication request.

func (*ClientAuthenticationRequest) Descriptor

func (*ClientAuthenticationRequest) Descriptor() ([]byte, []int)

func (*ClientAuthenticationRequest) GetSignature

func (m *ClientAuthenticationRequest) GetSignature() []byte

func (*ClientAuthenticationRequest) ProtoMessage

func (*ClientAuthenticationRequest) ProtoMessage()

func (*ClientAuthenticationRequest) Reset

func (m *ClientAuthenticationRequest) Reset()

func (*ClientAuthenticationRequest) String

func (m *ClientAuthenticationRequest) String() string

func (*ClientAuthenticationRequest) XXX_DiscardUnknown

func (m *ClientAuthenticationRequest) XXX_DiscardUnknown()

func (*ClientAuthenticationRequest) XXX_Marshal

func (m *ClientAuthenticationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClientAuthenticationRequest) XXX_Merge

func (m *ClientAuthenticationRequest) XXX_Merge(src proto.Message)

func (*ClientAuthenticationRequest) XXX_Size

func (m *ClientAuthenticationRequest) XXX_Size() int

func (*ClientAuthenticationRequest) XXX_Unmarshal

func (m *ClientAuthenticationRequest) XXX_Unmarshal(b []byte) error

type ClientAuthenticationResponse

type ClientAuthenticationResponse struct {
	//* Indication that user is authenticated.
	Authenticated bool `protobuf:"varint,1,opt,name=authenticated,proto3" json:"authenticated,omitempty"`
	//* Message from IO manager. Set in case of error.
	Message *StatusMessage `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	//* ID of started session.
	SessionId            string   `protobuf:"bytes,3,opt,name=session_id,json=sessionID,proto3" json:"session_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* User authentication response.

func (*ClientAuthenticationResponse) Descriptor

func (*ClientAuthenticationResponse) Descriptor() ([]byte, []int)

func (*ClientAuthenticationResponse) GetAuthenticated

func (m *ClientAuthenticationResponse) GetAuthenticated() bool

func (*ClientAuthenticationResponse) GetMessage

func (*ClientAuthenticationResponse) GetSessionId

func (m *ClientAuthenticationResponse) GetSessionId() string

func (*ClientAuthenticationResponse) ProtoMessage

func (*ClientAuthenticationResponse) ProtoMessage()

func (*ClientAuthenticationResponse) Reset

func (m *ClientAuthenticationResponse) Reset()

func (*ClientAuthenticationResponse) String

func (*ClientAuthenticationResponse) XXX_DiscardUnknown

func (m *ClientAuthenticationResponse) XXX_DiscardUnknown()

func (*ClientAuthenticationResponse) XXX_Marshal

func (m *ClientAuthenticationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClientAuthenticationResponse) XXX_Merge

func (m *ClientAuthenticationResponse) XXX_Merge(src proto.Message)

func (*ClientAuthenticationResponse) XXX_Size

func (m *ClientAuthenticationResponse) XXX_Size() int

func (*ClientAuthenticationResponse) XXX_Unmarshal

func (m *ClientAuthenticationResponse) XXX_Unmarshal(b []byte) error

type ColumnDataType

type ColumnDataType int32

* Column data types.

const (
	ColumnDataType_COLUMN_DATA_TYPE_BOOL   ColumnDataType = 0
	ColumnDataType_COLUMN_DATA_TYPE_INT8   ColumnDataType = 1
	ColumnDataType_COLUMN_DATA_TYPE_UINT8  ColumnDataType = 2
	ColumnDataType_COLUMN_DATA_TYPE_INT16  ColumnDataType = 3
	ColumnDataType_COLUMN_DATA_TYPE_UINT16 ColumnDataType = 4
	ColumnDataType_COLUMN_DATA_TYPE_INT32  ColumnDataType = 5
	ColumnDataType_COLUMN_DATA_TYPE_UINT32 ColumnDataType = 6
	ColumnDataType_COLUMN_DATA_TYPE_INT64  ColumnDataType = 7
	ColumnDataType_COLUMN_DATA_TYPE_UINT64 ColumnDataType = 8
	ColumnDataType_COLUMN_DATA_TYPE_FLOAT  ColumnDataType = 9
	ColumnDataType_COLUMN_DATA_TYPE_DOUBLE ColumnDataType = 10
	/// 64-bit IEEE-754 floating-point number
	ColumnDataType_COLUMN_DATA_TYPE_TEXT  ColumnDataType = 11
	ColumnDataType_COLUMN_DATA_TYPE_NTEXT ColumnDataType = 12
	/// Textual data with altertnative encoding
	ColumnDataType_COLUMN_DATA_TYPE_BINARY       ColumnDataType = 13
	ColumnDataType_COLUMN_DATA_TYPE_DATE         ColumnDataType = 14
	ColumnDataType_COLUMN_DATA_TYPE_TIME         ColumnDataType = 15
	ColumnDataType_COLUMN_DATA_TYPE_TIME_WITH_TZ ColumnDataType = 16
	/// Time with time zone
	ColumnDataType_COLUMN_DATA_TYPE_TIMESTAMP         ColumnDataType = 17
	ColumnDataType_COLUMN_DATA_TYPE_TIMESTAMP_WITH_TZ ColumnDataType = 18
	/// Date and time with time zone
	ColumnDataType_COLUMN_DATA_TYPE_DATE_INTERVAL ColumnDataType = 19
	ColumnDataType_COLUMN_DATA_TYPE_TIME_INTERVAL ColumnDataType = 20
	ColumnDataType_COLUMN_DATA_TYPE_STRUCT        ColumnDataType = 21
	ColumnDataType_COLUMN_DATA_TYPE_XML           ColumnDataType = 22
	ColumnDataType_COLUMN_DATA_TYPE_JSON          ColumnDataType = 23
	ColumnDataType_COLUMN_DATA_TYPE_UUID          ColumnDataType = 24
	ColumnDataType_COLUMN_DATA_TYPE_MAX           ColumnDataType = 25
	ColumnDataType_COLUMN_DATA_TYPE_UNKNOWN       ColumnDataType = 127
)

func (ColumnDataType) EnumDescriptor

func (ColumnDataType) EnumDescriptor() ([]byte, []int)

func (ColumnDataType) String

func (x ColumnDataType) String() string

type ColumnDescription

type ColumnDescription struct {
	//* Column name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	//* Column type.
	Type ColumnDataType `protobuf:"varint,2,opt,name=type,proto3,enum=siodb.ColumnDataType" json:"type,omitempty"`
	//* Column can have null values.
	IsNull bool `protobuf:"varint,3,opt,name=is_null,json=isNull,proto3" json:"is_null,omitempty"`
	//* Attributes of a structured data type
	Attribute            []*AttributeDescription `protobuf:"bytes,4,rep,name=attribute,proto3" json:"attribute,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

* Describes column returned by server

func (*ColumnDescription) Descriptor

func (*ColumnDescription) Descriptor() ([]byte, []int)

func (*ColumnDescription) GetAttribute

func (m *ColumnDescription) GetAttribute() []*AttributeDescription

func (*ColumnDescription) GetIsNull

func (m *ColumnDescription) GetIsNull() bool

func (*ColumnDescription) GetName

func (m *ColumnDescription) GetName() string

func (*ColumnDescription) GetType

func (m *ColumnDescription) GetType() ColumnDataType

func (*ColumnDescription) ProtoMessage

func (*ColumnDescription) ProtoMessage()

func (*ColumnDescription) Reset

func (m *ColumnDescription) Reset()

func (*ColumnDescription) String

func (m *ColumnDescription) String() string

func (*ColumnDescription) XXX_DiscardUnknown

func (m *ColumnDescription) XXX_DiscardUnknown()

func (*ColumnDescription) XXX_Marshal

func (m *ColumnDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ColumnDescription) XXX_Merge

func (m *ColumnDescription) XXX_Merge(src proto.Message)

func (*ColumnDescription) XXX_Size

func (m *ColumnDescription) XXX_Size() int

func (*ColumnDescription) XXX_Unmarshal

func (m *ColumnDescription) XXX_Unmarshal(b []byte) error

type Command

type Command struct {
	//* Request ID
	RequestID uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	//* Command text
	Text                 string   `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* Command from client to server.

func (*Command) Descriptor

func (*Command) Descriptor() ([]byte, []int)

func (*Command) GetRequestID

func (m *Command) GetRequestID() uint64

func (*Command) GetText

func (m *Command) GetText() string

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) Reset

func (m *Command) Reset()

func (*Command) String

func (m *Command) String() string

func (*Command) XXX_DiscardUnknown

func (m *Command) XXX_DiscardUnknown()

func (*Command) XXX_Marshal

func (m *Command) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Command) XXX_Merge

func (m *Command) XXX_Merge(src proto.Message)

func (*Command) XXX_Size

func (m *Command) XXX_Size() int

func (*Command) XXX_Unmarshal

func (m *Command) XXX_Unmarshal(b []byte) error

type Config

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

Config holds the connection Configuration

type ServerResponse

type ServerResponse struct {
	//* Corresponding request ID.
	RequestID uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	//* Messages from server.
	Message []*StatusMessage `protobuf:"bytes,2,rep,name=message,proto3" json:"message,omitempty"`
	//* Description of columns in this data set.
	ColumnDescription []*ColumnDescription `protobuf:"bytes,3,rep,name=column_description,json=columnDescription,proto3" json:"column_description,omitempty"`
	//* Free text messages without status code.
	FreetextMessage []string `protobuf:"bytes,4,rep,name=freetext_message,json=freetextMessage,proto3" json:"freetext_message,omitempty"`
	//* Number of this response in series of responses. Starts with 0.
	ResponseId uint32 `protobuf:"varint,5,opt,name=response_id,json=responseId,proto3" json:"response_id,omitempty"`
	//*
	// Number of reponses in series.
	// May be sent only in first response.
	// Zero value means single response.
	ResponseCount uint32 `protobuf:"varint,6,opt,name=response_count,json=responseCount,proto3" json:"response_count,omitempty"`
	//* Indicates that affected row count is presents.
	HasAffectedRowCount bool `protobuf:"varint,7,opt,name=has_affected_row_count,json=hasAffectedRowCount,proto3" json:"has_affected_row_count,omitempty"`
	//* Affected row count.
	AffectedRowCount     uint64   `protobuf:"varint,8,opt,name=affected_row_count,json=affectedRowCount,proto3" json:"affected_row_count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* Response from server.

func (*ServerResponse) Descriptor

func (*ServerResponse) Descriptor() ([]byte, []int)

func (*ServerResponse) GetAffectedRowCount

func (m *ServerResponse) GetAffectedRowCount() uint64

func (*ServerResponse) GetColumnDescription

func (m *ServerResponse) GetColumnDescription() []*ColumnDescription

func (*ServerResponse) GetFreetextMessage

func (m *ServerResponse) GetFreetextMessage() []string

func (*ServerResponse) GetHasAffectedRowCount

func (m *ServerResponse) GetHasAffectedRowCount() bool

func (*ServerResponse) GetMessage

func (m *ServerResponse) GetMessage() []*StatusMessage

func (*ServerResponse) GetRequestID

func (m *ServerResponse) GetRequestID() uint64

func (*ServerResponse) GetResponseCount

func (m *ServerResponse) GetResponseCount() uint32

func (*ServerResponse) GetResponseId

func (m *ServerResponse) GetResponseId() uint32

func (*ServerResponse) ProtoMessage

func (*ServerResponse) ProtoMessage()

func (*ServerResponse) Reset

func (m *ServerResponse) Reset()

func (*ServerResponse) String

func (m *ServerResponse) String() string

func (*ServerResponse) XXX_DiscardUnknown

func (m *ServerResponse) XXX_DiscardUnknown()

func (*ServerResponse) XXX_Marshal

func (m *ServerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServerResponse) XXX_Merge

func (m *ServerResponse) XXX_Merge(src proto.Message)

func (*ServerResponse) XXX_Size

func (m *ServerResponse) XXX_Size() int

func (*ServerResponse) XXX_Unmarshal

func (m *ServerResponse) XXX_Unmarshal(b []byte) error

type StatusMessage

type StatusMessage struct {
	//* Message status code.
	StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	//* Message text.
	Text                 string   `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* Single message from server or IO manager.

func (*StatusMessage) Descriptor

func (*StatusMessage) Descriptor() ([]byte, []int)

func (*StatusMessage) GetStatusCode

func (m *StatusMessage) GetStatusCode() int32

func (*StatusMessage) GetText

func (m *StatusMessage) GetText() string

func (*StatusMessage) ProtoMessage

func (*StatusMessage) ProtoMessage()

func (*StatusMessage) Reset

func (m *StatusMessage) Reset()

func (*StatusMessage) String

func (m *StatusMessage) String() string

func (*StatusMessage) XXX_DiscardUnknown

func (m *StatusMessage) XXX_DiscardUnknown()

func (*StatusMessage) XXX_Marshal

func (m *StatusMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StatusMessage) XXX_Merge

func (m *StatusMessage) XXX_Merge(src proto.Message)

func (*StatusMessage) XXX_Size

func (m *StatusMessage) XXX_Size() int

func (*StatusMessage) XXX_Unmarshal

func (m *StatusMessage) XXX_Unmarshal(b []byte) error