go-ignite-client DEPRECATED. See new repo: ignite-go-client
- Apache Ignite v1.3+
- go v1.8+
- Develop SQL driver (
ignite-sql-http
) for Apache Ignite HTTP REST API (In progress) - Develop SQL driver (
ignite-sql-native
) for Apache Ignite protocol (Not started)
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
# go get -u github.com/amsokol/go-ignite-client/sql/http
See example
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
- typenumber
, optional, default value is1
. Ignite HTTP REST API version you are going to use.1
is for1.x.x
server,2
is for 2.x.x serverservers
- typeURL
s, mandatory, no default value. Ignite server list. Client automatically reconnects to another server if current server become unavailableusername
- typestring
, optional, no default value. User name to connect to servers. Client supports HTTP Basic Authenticationpassword
- typestring
, optional, no default value. Password to connect to servers. Client supports HTTP Basic Authenticationcache
- typestring
, mandatory. Ignite cache name as the default schema for SQL query. But I recommend provide table schema (cache name) in each SQL query explicitlypageSize
- typeint
, optional, default value is1000
. 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 bypageSize
property.
Ignite (Java) type | golang type |
---|---|
java.lang.Byte | int8 |
java.lang.Short | int16 |
java.lang.Integer | int32 |
java.lang.Long | int64 |
java.lang.Double | float64 |
java.lang.Float | float32 |
java.lang.Boolean | bool |
java.lang.Character | []rune |
java.lang.String | string |
java.sql.Timestamp | time.Time |
java.util.Date | time.Time |
See https://apacheignite.readme.io/docs/rest-api for API specification
# go get -u github.com/amsokol/go-ignite-client/http/v2
or if you want use v1 API:
# go get -u github.com/amsokol/go-ignite-client/http/v1
See example