Mysqlx_Resultset

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2017 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package Mysqlx_Resultset is a generated protocol buffer package.

It is generated from these files:

github.com/pingcap/tipb/go-mysqlx/Resultset/mysqlx_resultset.proto

It has these top-level messages:

FetchDoneMoreOutParams
FetchDoneMoreResultsets
FetchDone
ColumnMetaData
Row

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthMysqlxResultset = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMysqlxResultset   = fmt.Errorf("proto: integer overflow")
)
View Source
var ColumnMetaData_FieldType_name = map[int32]string{
	1:  "SINT",
	2:  "UINT",
	5:  "DOUBLE",
	6:  "FLOAT",
	7:  "BYTES",
	10: "TIME",
	12: "DATETIME",
	15: "SET",
	16: "ENUM",
	17: "BIT",
	18: "DECIMAL",
}
View Source
var ColumnMetaData_FieldType_value = map[string]int32{
	"SINT":     1,
	"UINT":     2,
	"DOUBLE":   5,
	"FLOAT":    6,
	"BYTES":    7,
	"TIME":     10,
	"DATETIME": 12,
	"SET":      15,
	"ENUM":     16,
	"BIT":      17,
	"DECIMAL":  18,
}

Functions

This section is empty.

Types

type ColumnMetaData

type ColumnMetaData struct {
	// datatype of the field in a row
	Type             *ColumnMetaData_FieldType `protobuf:"varint,1,req,name=type,enum=Mysqlx.Resultset.ColumnMetaData_FieldType" json:"type,omitempty"`
	Name             []byte                    `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	OriginalName     []byte                    `protobuf:"bytes,3,opt,name=original_name,json=originalName" json:"original_name,omitempty"`
	Table            []byte                    `protobuf:"bytes,4,opt,name=table" json:"table,omitempty"`
	OriginalTable    []byte                    `protobuf:"bytes,5,opt,name=original_table,json=originalTable" json:"original_table,omitempty"`
	Schema           []byte                    `protobuf:"bytes,6,opt,name=schema" json:"schema,omitempty"`
	Catalog          []byte                    `protobuf:"bytes,7,opt,name=catalog" json:"catalog,omitempty"`
	Collation        *uint64                   `protobuf:"varint,8,opt,name=collation" json:"collation,omitempty"`
	FractionalDigits *uint32                   `protobuf:"varint,9,opt,name=fractional_digits,json=fractionalDigits" json:"fractional_digits,omitempty"`
	Length           *uint32                   `protobuf:"varint,10,opt,name=length" json:"length,omitempty"`
	Flags            *uint32                   `protobuf:"varint,11,opt,name=flags" json:"flags,omitempty"`
	ContentType      *uint32                   `protobuf:"varint,12,opt,name=content_type,json=contentType" json:"content_type,omitempty"`
	XXX_unrecognized []byte                    `json:"-"`
}

meta data of a Column

.. note:: the encoding used for the different “bytes“ fields in the meta data is externally

controlled.
.. seealso:: https://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

.. note::

The server may not set the ``original_{table|name}`` fields if they are equal to the plain
``{table|name}`` field.

A client has to reconstruct it like::

  if .original_name is empty and .name is not empty:
    .original_name = .name

  if .original_table is empty and .table is not empty:
    .original_table = .table

.. note::

``compact metadata format`` can be requested by the client. In that case only ``.type`` is set and
all other fields are empty.

:param type:

.. table:: Expected Datatype of Mysqlx.Resultset.Row per SQL Type for non NULL values

  ================= ============ ======= ========== ====== ========
  SQL Type          .type        .length .frac_dig  .flags .charset
  ================= ============ ======= ========== ====== ========
  TINY              SINT         x
  TINY UNSIGNED     UINT         x                  x
  SHORT             SINT         x
  SHORT UNSIGNED    UINT         x                  x
  INT24             SINT         x
  INT24 UNSIGNED    UINT         x                  x
  INT               SINT         x
  INT UNSIGNED      UINT         x                  x
  LONGLONG          SINT         x
  LONGLONG UNSIGNED UINT         x                  x
  DOUBLE            DOUBLE       x       x          x
  FLOAT             FLOAT        x       x          x
  DECIMAL           DECIMAL      x       x          x
  VARCHAR,CHAR,...  BYTES        x                  x      x
  GEOMETRY          BYTES
  TIME              TIME         x
  DATE              DATETIME     x
  DATETIME          DATETIME     x
  YEAR              UINT         x                  x
  TIMESTAMP         DATETIME     x
  SET               SET                                    x
  ENUM              ENUM                                   x
  NULL              BYTES
  BIT               BIT          x
  ================= ============ ======= ========== ====== ========

.. note:: the SQL "NULL" value is sent as an empty field value in :protobuf:msg:`Mysqlx.Resultset::Row`
.. seealso:: protobuf encoding of primitive datatypes are decribed in https://developers.google.com/protocol-buffers/docs/encoding

SINT

  ``.length``
    maximum number of displayable decimal digits (including minus sign) of the type

    .. note::
      valid range is 0-255, but usually you'll see 1-20

    =============== ==
    SQL Type        max digits per type
    =============== ==
    TINY SIGNED      4
    SHORT SIGNED     6
    INT24 SIGNED     8
    INT SIGNED      11
    LONGLONG SIGNED 20
    =============== ==

    .. seealso:: definition of ``M`` in https://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html

  ``value``
    variable length encoded signed 64 integer

UINT

  ``.flags & 1`` (zerofill)
    the client has to left pad with 0's up to .length

  ``.length``
    maximum number of displayable decimal digits of the type

    .. note::
      valid range is 0-255, but usually you'll see 1-20

    ================= ==
    SQL Type          max digits per type
    ================= ==
    TINY UNSIGNED      3
    SHORT UNSIGNED     5
    INT24 UNSIGNED     8
    INT UNSIGNED      10
    LONGLONG UNSIGNED 20
    ================= ==

    .. seealso:: definition of ``M`` in https://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html

  ``value``
    variable length encoded unsigned 64 integer

BIT

  ``.length``
    maximum number of displayable binary digits

    .. note:: valid range for M of the ``BIT`` type is 1 - 64
    .. seealso:: https://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html

  ``value``
    variable length encoded unsigned 64 integer

DOUBLE

  ``.length``
    maximum number of displayable decimal digits (including the decimal point and ``.fractional_digits``)

  ``.fractional_digits``
    maximum number of displayable decimal digits following the decimal point

  ``value``
    encoded as Protobuf's 'double'

FLOAT

  ``.length``
    maximum number of displayable decimal digits (including the decimal point and ``.fractional_digits``)

  ``.fractional_digits``
    maximum number of displayable decimal digits following the decimal point

  ``value``
    encoded as Protobuf's 'float'

BYTES, ENUM
  BYTES is used for all opaque byte strings that may have a charset

    * TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB
    * TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT
    * VARCHAR, VARBINARY
    * CHAR, BINARY
    * ENUM

  ``.length``
    the maximum length of characters of the underlying type

  ``.flags & 1`` (rightpad)
    if the length of the field is less than ``.length``, the receiver is
    supposed to add padding characters to the right end of the string.
    If the ``.charset`` is "binary", the padding character is ``0x00``,
    otherwise it is a space character as defined by that character set.

    ============= ======= ======== =======
    SQL Type      .length .charset .flags
    ============= ======= ======== =======
    TINYBLOB      256     binary
    BLOB          65535   binary
    VARCHAR(32)   32      utf8
    VARBINARY(32) 32      utf8_bin
    BINARY(32)    32      binary   rightpad
    CHAR(32)      32      utf8     rightpad
    ============= ======= ======== =======

  ``value``
    sequence of bytes with added one extra '\0' byte at the end. To obtain the
    original string, the extra '\0' should be removed.
    .. note:: the length of the string can be acquired with protobuf's field length() method
      length of sequence-of-bytes = length-of-field - 1
    .. note:: the extra byte allows to distinguish between a NULL and empty byte sequence

TIME
  A time value.

  ``value``
    the following bytes sequence:

      ``| negate [ | hour | [ | minutes | [ | seconds | [ | useconds | ]]]]``

    * negate - one byte, should be one of: 0x00 for "+", 0x01 for "-"
    * hour - optional variable length encoded unsigned64 value for the hour
    * minutes - optional variable length encoded unsigned64 value for the minutes
    * seconds - optional variable length encoded unsigned64 value for the seconds
    * useconds - optional variable length encoded unsigned64 value for the microseconds

    .. seealso:: protobuf encoding in https://developers.google.com/protocol-buffers/docs/encoding
    .. note:: hour, minutes, seconds, useconds are optional if all the values to the right are 0

    Example: 0x00 -> +00:00:00.000000

DATETIME
  A date or date and time value.

  ``value``
    a sequence of variants, arranged as follows:

      ``| year | month | day | [ | hour | [ | minutes | [ | seconds | [ | useconds | ]]]]``

    * year - variable length encoded unsigned64 value for the year
    * month - variable length encoded unsigned64 value for the month
    * day - variable length encoded unsigned64 value for the day
    * hour - optional variable length encoded unsigned64 value for the hour
    * minutes - optional variable length encoded unsigned64 value for the minutes
    * seconds - optional variable length encoded unsigned64 value for the seconds
    * useconds - optional variable length encoded unsigned64 value for the microseconds

    .. note:: hour, minutes, seconds, useconds are optional if all the values to the right are 0

  ``.flags & 1`` (timestamp)

    ============= =======
    SQL Type      .flags
    ============= =======
    DATETIME
    TIMESTAMP     1

DECIMAL
  An arbitrary length number. The number is encoded as a single byte
  indicating the position of the decimal point followed by the Packed BCD
  encoded number. Packed BCD is used to simplify conversion to and
  from strings and other native arbitrary precision math datatypes.
  .. seealso:: packed BCD in https://en.wikipedia.org/wiki/Binary-coded_decimal

  ``.length``
    maximum number of displayable decimal digits (*excluding* the decimal point and sign, but including ``.fractional_digits``)

    .. note:: should be in the range of 1 - 65

  ``.fractional_digits``
    is the decimal digits to display out of length

    .. note:: should be in the range of 0 - 30

  ``value``
    the following bytes sequence:

      ``| scale | BCD | sign | [0x0] |``

    * scale - 8bit scale value (number of decimal digit after the '.')
    * BCD - BCD encoded digits (4 bits for each digit)
    * sign - sign encoded on 4 bits (0xc = "+", 0xd = "-")
    * 0x0 - last 4bits if length(digits) % 2 == 0

    Example: x04 0x12 0x34 0x01 0xd0 -> -12.3401

SET
  A list of strings representing a SET of values.

  ``value``
    A sequence of 0 or more of protobuf's bytes (length prepended octets) or one of
    the special sequences with a predefined meaning listed below.

    Example (length of the bytes array shown in brackets):
      * ``[0]`` - the NULL value
      * ``[1] 0x00`` - a set containing a blank string ''
      * ``[1] 0x01`` - this would be an invalid value, but is to be treated as the empty set
      * ``[2] 0x01 0x00`` - a set with a single item, which is the '\0' character
      * ``[8] 0x03 F O O 0x03 B A R`` - a set with 2 items: FOO,BAR

:param name: name of the column :param original_name: name of the column before an alias was applied :param table: name of the table the column orginates from :param original_table: name of the table the column orginates from before an alias was applied :param schema: schema the column originates from :param catalog:

catalog the schema originates from

.. note::
  as there is current no support for catalogs in MySQL, don't expect this field to be set.
  In the MySQL C/S protocol the field had the value ``def`` all the time.

:param fractional_digits: displayed factional decimal digits for floating point and fixed point numbers :param length: maximum count of displayable characters of .type :param flags:

``.type`` specific flags

======= ====== ===========
type    value  description
======= ====== ===========
UINT    0x0001 zerofill
DOUBLE  0x0001 unsigned
FLOAT   0x0001 unsigned
DECIMAL 0x0001 unsigned
BYTES   0x0001 rightpad
======= ====== ===========

====== ================
value  description
====== ================
0x0010 NOT_NULL
0x0020 PRIMARY_KEY
0x0040 UNIQUE_KEY
0x0080 MULTIPLE_KEY
0x0100 AUTO_INCREMENT
====== ================

default: 0

:param content_type:

a hint about the higher-level encoding of a BYTES field

====== ====== ===========
type   value  description
====== ====== ===========
BYTES  0x0001 GEOMETRY (WKB encoding)
BYTES  0x0002 JSON (text encoding)
BYTES  0x0003 XML (text encoding)
====== ====== ===========

.. note::
  this list isn't comprehensive. As guideline: the field's value is expected
  to pass a validator check on client and server if this field is set.
  If the server adds more internal datatypes that rely on BLOB storage
  like image manipulation, seeking into complex types in BLOBs, ... more
  types will be added.

func (*ColumnMetaData) Descriptor

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

func (*ColumnMetaData) GetCatalog

func (m *ColumnMetaData) GetCatalog() []byte

func (*ColumnMetaData) GetCollation

func (m *ColumnMetaData) GetCollation() uint64

func (*ColumnMetaData) GetContentType

func (m *ColumnMetaData) GetContentType() uint32

func (*ColumnMetaData) GetFlags

func (m *ColumnMetaData) GetFlags() uint32

func (*ColumnMetaData) GetFractionalDigits

func (m *ColumnMetaData) GetFractionalDigits() uint32

func (*ColumnMetaData) GetLength

func (m *ColumnMetaData) GetLength() uint32

func (*ColumnMetaData) GetName

func (m *ColumnMetaData) GetName() []byte

func (*ColumnMetaData) GetOriginalName

func (m *ColumnMetaData) GetOriginalName() []byte

func (*ColumnMetaData) GetOriginalTable

func (m *ColumnMetaData) GetOriginalTable() []byte

func (*ColumnMetaData) GetSchema

func (m *ColumnMetaData) GetSchema() []byte

func (*ColumnMetaData) GetTable

func (m *ColumnMetaData) GetTable() []byte

func (*ColumnMetaData) GetType

func (*ColumnMetaData) Marshal

func (m *ColumnMetaData) Marshal() (dAtA []byte, err error)

func (*ColumnMetaData) MarshalTo

func (m *ColumnMetaData) MarshalTo(dAtA []byte) (int, error)

func (*ColumnMetaData) ProtoMessage

func (*ColumnMetaData) ProtoMessage()

func (*ColumnMetaData) Reset

func (m *ColumnMetaData) Reset()

func (*ColumnMetaData) Size

func (m *ColumnMetaData) Size() (n int)

func (*ColumnMetaData) String

func (m *ColumnMetaData) String() string

func (*ColumnMetaData) Unmarshal

func (m *ColumnMetaData) Unmarshal(dAtA []byte) error

type ColumnMetaData_FieldType

type ColumnMetaData_FieldType int32
const (
	ColumnMetaData_SINT     ColumnMetaData_FieldType = 1
	ColumnMetaData_UINT     ColumnMetaData_FieldType = 2
	ColumnMetaData_DOUBLE   ColumnMetaData_FieldType = 5
	ColumnMetaData_FLOAT    ColumnMetaData_FieldType = 6
	ColumnMetaData_BYTES    ColumnMetaData_FieldType = 7
	ColumnMetaData_TIME     ColumnMetaData_FieldType = 10
	ColumnMetaData_DATETIME ColumnMetaData_FieldType = 12
	ColumnMetaData_SET      ColumnMetaData_FieldType = 15
	ColumnMetaData_ENUM     ColumnMetaData_FieldType = 16
	ColumnMetaData_BIT      ColumnMetaData_FieldType = 17
	ColumnMetaData_DECIMAL  ColumnMetaData_FieldType = 18
)

func (ColumnMetaData_FieldType) Enum

func (ColumnMetaData_FieldType) EnumDescriptor

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

func (ColumnMetaData_FieldType) String

func (x ColumnMetaData_FieldType) String() string

func (*ColumnMetaData_FieldType) UnmarshalJSON

func (x *ColumnMetaData_FieldType) UnmarshalJSON(data []byte) error

type FetchDone

type FetchDone struct {
	XXX_unrecognized []byte `json:"-"`
}

all resultsets are finished

func (*FetchDone) Descriptor

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

func (*FetchDone) Marshal

func (m *FetchDone) Marshal() (dAtA []byte, err error)

func (*FetchDone) MarshalTo

func (m *FetchDone) MarshalTo(dAtA []byte) (int, error)

func (*FetchDone) ProtoMessage

func (*FetchDone) ProtoMessage()

func (*FetchDone) Reset

func (m *FetchDone) Reset()

func (*FetchDone) Size

func (m *FetchDone) Size() (n int)

func (*FetchDone) String

func (m *FetchDone) String() string

func (*FetchDone) Unmarshal

func (m *FetchDone) Unmarshal(dAtA []byte) error

type FetchDoneMoreOutParams

type FetchDoneMoreOutParams struct {
	XXX_unrecognized []byte `json:"-"`
}

resultsets are finished, OUT paramset is next

func (*FetchDoneMoreOutParams) Descriptor

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

func (*FetchDoneMoreOutParams) Marshal

func (m *FetchDoneMoreOutParams) Marshal() (dAtA []byte, err error)

func (*FetchDoneMoreOutParams) MarshalTo

func (m *FetchDoneMoreOutParams) MarshalTo(dAtA []byte) (int, error)

func (*FetchDoneMoreOutParams) ProtoMessage

func (*FetchDoneMoreOutParams) ProtoMessage()

func (*FetchDoneMoreOutParams) Reset

func (m *FetchDoneMoreOutParams) Reset()

func (*FetchDoneMoreOutParams) Size

func (m *FetchDoneMoreOutParams) Size() (n int)

func (*FetchDoneMoreOutParams) String

func (m *FetchDoneMoreOutParams) String() string

func (*FetchDoneMoreOutParams) Unmarshal

func (m *FetchDoneMoreOutParams) Unmarshal(dAtA []byte) error

type FetchDoneMoreResultsets

type FetchDoneMoreResultsets struct {
	XXX_unrecognized []byte `json:"-"`
}

resultset and out-params are finished, but more resultsets available

func (*FetchDoneMoreResultsets) Descriptor

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

func (*FetchDoneMoreResultsets) Marshal

func (m *FetchDoneMoreResultsets) Marshal() (dAtA []byte, err error)

func (*FetchDoneMoreResultsets) MarshalTo

func (m *FetchDoneMoreResultsets) MarshalTo(dAtA []byte) (int, error)

func (*FetchDoneMoreResultsets) ProtoMessage

func (*FetchDoneMoreResultsets) ProtoMessage()

func (*FetchDoneMoreResultsets) Reset

func (m *FetchDoneMoreResultsets) Reset()

func (*FetchDoneMoreResultsets) Size

func (m *FetchDoneMoreResultsets) Size() (n int)

func (*FetchDoneMoreResultsets) String

func (m *FetchDoneMoreResultsets) String() string

func (*FetchDoneMoreResultsets) Unmarshal

func (m *FetchDoneMoreResultsets) Unmarshal(dAtA []byte) error

type Row

type Row struct {
	Field            [][]byte `protobuf:"bytes,1,rep,name=field" json:"field,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

Row in a Resultset

a row is represented as a list of fields encoded as byte blobs. Blob of size 0 represents the NULL value. Otherwise, if it contains at least one byte, it encodes a non-null value of the field using encoding appropriate for the type of the value given by “ColumnMetadata“, as specified in the :protobuf:msg:`Mysqlx.Resultset::ColumnMetaData` description.

func (*Row) Descriptor

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

func (*Row) GetField

func (m *Row) GetField() [][]byte

func (*Row) Marshal

func (m *Row) Marshal() (dAtA []byte, err error)

func (*Row) MarshalTo

func (m *Row) MarshalTo(dAtA []byte) (int, error)

func (*Row) ProtoMessage

func (*Row) ProtoMessage()

func (*Row) Reset

func (m *Row) Reset()

func (*Row) Size

func (m *Row) Size() (n int)

func (*Row) String

func (m *Row) String() string

func (*Row) Unmarshal

func (m *Row) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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