Categorygithub.com/amsokol/go-ignite-client
repository
1.0.0-beta.2
Repository: https://github.com/amsokol/go-ignite-client.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

go-ignite-client

Apache Ignite (GridGain) go language native client and SQL driver

Requirements:

  • Apache Ignite v1.3+
  • go v1.8+

Road map:

  1. Develop SQL driver (ignite-sql-http) for Apache Ignite HTTP REST API (In progress)
  2. Develop SQL driver (ignite-sql-native) for Apache Ignite protocol (Not started)

Issues:

  • ignite-sql-http SQL driver does not support transactions (Ignite HTTP REST API does not support transactions)
  • Only 4 methods (are needed for SQL driver) of REST API are implemented now

SQL driver (ignite-sql-http) for Apache Ignite HTTP REST API:

go get -u github.com/amsokol/go-ignite-client/sql/http

See example

Data base configuration string json format:

Example:

{
    "version": 2,
    "servers" : [
        "http://server1:8080/ignite",
        "http://server2:8080/ignite",
        "http://server3:8080/ignite"
    ],
    "username" : "myLogin",
    "password": "myPassword",
    "cache" : "Person",
    "pageSize": 1000
}

Specification:

  • version - type number, optional, default value is 1. Ignite HTTP REST API version you are going to use. 1 is for 1.x.x server, 2 is for 2.x.x server
  • servers - type URLs, mandatory, no default value. Ignite server list. Client automatically reconnects to another server if current server become unavailable
  • username - type string, optional, no default value. User name to connect to servers. Client supports HTTP Basic Authentication
  • password - type string, optional, no default value. Password to connect to servers. Client supports HTTP Basic Authentication
  • cache- type string, mandatory. Ignite cache name as the default schema for SQL query. But I recommend provide table schema (cache name) in each SQL query explicitly
  • pageSize- type int, optional, default value is 1000. Pagination in Ignite is a mechanism to avoid fetching the whole data set from server nodes to the client. I.e., while you iterate through the Rows, the client will fetch data in chunks. The size of each chunk is defined by pageSize property.

Database fields mapping (Ignite -> golang and visa verse):

Ignite (Java) typegolang type
java.lang.Byteint8
java.lang.Shortint16
java.lang.Integerint32
java.lang.Longint64
java.lang.Doublefloat64
java.lang.Floatfloat32
java.lang.Booleanbool
java.lang.Character[]rune
java.lang.Stringstring
java.sql.Timestamptime.Time
java.util.Datetime.Time

Apache Ignite HTTP REST API client:

go get -u github.com/amsokol/go-ignite-client/http

See example