Skip to content

Could I use SQL syntax to query to Tarantool? #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zlinwei opened this issue Apr 14, 2018 · 3 comments · Fixed by #144
Closed

Could I use SQL syntax to query to Tarantool? #62

zlinwei opened this issue Apr 14, 2018 · 3 comments · Fixed by #144
Assignees
Labels
feature A new functionality

Comments

@zlinwei
Copy link

zlinwei commented Apr 14, 2018

Like this:
resp, err := conn.Eval(SELECT * FROM table1 WHERE column1 = 1;, []interface{}{})

Because I don't like to use the 'box.sql.execute'.

@eaglemoor
Copy link

What prevents you from doing a wrapper over conn and inserting the Eval function there?

@Totktonada
Copy link
Member

Let's consider this issue as 'bare minimum SQL support': just IPROTO_EXECUTE, without prepared statements and extended metainfo.

I would like to see an API proposal before we'll start the implementation.

@Totktonada Totktonada assigned vr009 and unassigned AnaNek Jan 13, 2022
vr009 added a commit that referenced this issue Mar 2, 2022
That patch adds the support of SQL in connector.

Fixes #62
vr009 added a commit that referenced this issue Mar 2, 2022
This patch adds the support of SQL in connector.

Fixes #62
vr009 added a commit that referenced this issue Mar 2, 2022
Added the test covered examples of using SQL from connector.
Updated config.lua by creation the space for testing SQL from
example.

Follows up #62
vr009 added a commit that referenced this issue Mar 3, 2022
This patch adds the support of SQL in connector.
Added all required constants in const.go for encoding SQL in msgpack.

Fixes #62
vr009 added a commit that referenced this issue Mar 3, 2022
Added the test covered examples of using SQL from connector.
Updated config.lua by creation the space for testing SQL from
example.

Follows up #62
vr009 added a commit that referenced this issue Mar 3, 2022
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if tarantool version < 2.0.0.

Follows up #62
vr009 added a commit that referenced this issue Mar 3, 2022
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if tarantool version < 2.0.0.

Follows up #62
@ligurio
Copy link
Member

ligurio commented Mar 9, 2022

Probably we need to create PR for docs as well, where update status of SQL support in connector.
Relevant file in doc repository is https://github.com/tarantool/doc/blob/latest/doc/book/connectors/__go.rst.

vr009 added a commit that referenced this issue Mar 17, 2022
This patch adds the support of SQL in connector.
Added support of positional and named arguments.
Added all required constants in const.go for encoding SQL
in msgpack and decoding response.

Fixes #62
vr009 added a commit that referenced this issue Mar 17, 2022
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if tarantool version < 2.0.0.
Changed id of the test space with id=512, cause if using SQL there is no ability
to set space id explicitly, so it gets created with id=512 by default
and conflicts with already existing space with the same id.

Follows up #62
vr009 added a commit that referenced this issue Mar 17, 2022
This patch adds the support of SQL in connector.
Added support of positional and named arguments.
Added all required constants in const.go for encoding SQL
in msgpack and decoding response.

Fixes #62
vr009 added a commit that referenced this issue Mar 17, 2022
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if tarantool version < 2.0.0.
Changed id of the test space with id=512, cause if using SQL there is no ability
to set space id explicitly, so it gets created with id=512 by default
and conflicts with already existing space with the same id.

Follows up #62
vr009 added a commit that referenced this issue Mar 21, 2022
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if tarantool version < 2.0.0.
Changed id of the test spaces with id=512 and id=514, cause if using SQL
in tarantool there is no ability to set space id explicitly, so it gets created
with id=512 by default and conflicts with already existing space with the same id.

Follows up #62
vr009 added a commit that referenced this issue Mar 23, 2022
This patch adds the support of SQL in connector.
Added support of positional and named arguments.
Added all required constants in const.go for encoding SQL
in msgpack and decoding response.

Fixes #62
vr009 added a commit that referenced this issue Mar 23, 2022
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if tarantool version < 2.0.0.

Changed id of the test spaces with id=512 and id=514, cause if using SQL
in tarantool there is no ability to set space id explicitly, so it gets created
with id=512 by default and conflicts with already existing space with the same id.

Follows up #62
vr009 added a commit that referenced this issue Mar 28, 2022
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if tarantool version < 2.0.0.

Changed id of the test spaces with id=512 and id=514, cause if using SQL
in tarantool there is no ability to set space id explicitly, so it gets created
with id=512 by default and conflicts with already existing space with the same id.

Added new dependency in go.sum, go.mod for using assert package.

Follows up #62
vr009 added a commit that referenced this issue Mar 28, 2022
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if tarantool version < 2.0.0.

Changed id of the test spaces with id=512 and id=514, cause if using SQL
in tarantool there is no ability to set space id explicitly, so it gets created
with id=512 by default and conflicts with already existing space with the same id.

Added new dependency in go.sum, go.mod for using assert package.

Follows up #62
vr009 added a commit that referenced this issue Mar 29, 2022
Added SQL tests. Updated config.lua for creation the space for
using SQL in tests. Added the check of Tarantool version to skip SQL
tests if tarantool version < 2.0.0.

Changed id of the test spaces with id=512 and id=514, cause if using SQL
in tarantool there is no ability to set space id explicitly, so it gets created
with id=512 by default and conflicts with already existing space with the same id.

Added new dependency in go.sum, go.mod for using assert package.

Follows up #62
vr009 added a commit that referenced this issue Jul 12, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 12, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 12, 2022
When using go test tool with different regexp for filtering
test functions, it is sometimes helpful to filter some of them
with any prefix like BenchmarkClientSerial or BenchmarkClientParallel.
This way it is possible to get results just for one type of load.

Follows up #62
Follows up #122
vr009 added a commit that referenced this issue Jul 12, 2022
Added ExecuteTyped/ExecuteAsync implementation to multi package.
CHANGELOG.md updated.

Follows up #62
vr009 added a commit that referenced this issue Jul 12, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 12, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.
Added mock for ConnectedRequest interface for tests.

Follows up #62
Closes #117
vr009 added a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.
Added mock for ConnectedRequest interface for tests.

Follows up #62
Closes #117
oleg-jukovec pushed a commit that referenced this issue Jul 13, 2022
When using go test tool with different regexp for filtering
test functions, it is sometimes helpful to filter some of them
with any prefix like BenchmarkClientSerial or BenchmarkClientParallel.
This way it is possible to get results just for one type of load.

Follows up #62
Follows up #122
oleg-jukovec pushed a commit that referenced this issue Jul 13, 2022
Added ExecuteTyped/ExecuteAsync implementation to multi package.
CHANGELOG.md updated.

Follows up #62
oleg-jukovec pushed a commit that referenced this issue Jul 13, 2022
This patch adds the support of prepared statements.
Added a new type for handling prepared statements.
Added new IPROTO-constants for support of prepared statements
in const.go.

Added benchmarks for SQL-select prepared statement.
Added examples of using Prepare in example_test.go.
Fixed some grammar inconsistencies for the method Execute.
Added a test helper for checking if SQL is supported in
connected Tarantool. Updated CHANGELOG.md.
Added mock for ConnectedRequest interface for tests.

Follows up #62
Closes #117
oleg-jukovec added a commit that referenced this issue Jul 27, 2022
Overview

This release adds a number of features. The extending of the public API
has become possible with a new way of creating requests. New types of
requests are created via chain calls:

selectReq := NewSelectRequest("space").
             Context(ctx).
			 Index(1).
			 Offset(5).
			 Limit(10)
future := conn.Do(selectReq)

Streams, context and prepared statements support are based on this
idea:

stream, err := conn.NewStream()
beginReq := NewBeginRequest().Context(ctx)
if response, err := stream.Do(beginReq).Get(); err != nil {
    selectFuture := stream.Do(selectReq)
    commitFuture := stream.Do(NewCommitRequest())
    // ...
}
```

Breaking changes

    NewErrorFuture function removed (#190).

    `IPROTO_*` constants that identify requests renamed from
    `<Name>Request` to `<Name>RequestCode` (#126)

New features

    SSL support (#155).

    IPROTO_PUSH messages support (#67).

    Public API with request object types (#126).

    Support decimal type in msgpack (#96).

    Support datetime type in msgpack (#118).

    Prepared SQL statements (#117).

    Streams and interactive transactions support (#101).

    `Call16` method, support build tag `go_tarantool_call_17`
    to choose default behavior for `Call` method as Call17 (#125)

Bugfixes

    Add `ExecuteAsync` and `ExecuteTyped` to common connector
    interface (#62).
oleg-jukovec added a commit to tarantool/doc that referenced this issue Aug 2, 2022
Add context, streams, SQL and push messages support in Go connector

Follows up tarantool/go-tarantool#48
Follows up tarantool/go-tarantool#62
Follows up tarantool/go-tarantool#67
Follows up tarantool/go-tarantool#101
oleg-jukovec added a commit to tarantool/doc that referenced this issue Aug 2, 2022
Add context, streams, SQL and push messages support in Go connector

Follows up tarantool/go-tarantool#48
Follows up tarantool/go-tarantool#62
Follows up tarantool/go-tarantool#67
Follows up tarantool/go-tarantool#101
oleg-jukovec added a commit that referenced this issue Aug 2, 2022
Overview

This release adds a number of features. The extending of the public API
has become possible with a new way of creating requests. New types of
requests are created via chain calls:

selectReq := NewSelectRequest("space").
             Context(ctx).
			 Index(1).
			 Offset(5).
			 Limit(10)
future := conn.Do(selectReq)

Streams, context and prepared statements support are based on this
idea:

stream, err := conn.NewStream()
beginReq := NewBeginRequest().Context(ctx)
if response, err := stream.Do(beginReq).Get(); err != nil {
    selectFuture := stream.Do(selectReq)
    commitFuture := stream.Do(NewCommitRequest())
    // ...
}
```

Breaking changes

    NewErrorFuture function removed (#190).

    `IPROTO_*` constants that identify requests renamed from
    `<Name>Request` to `<Name>RequestCode` (#126)

New features

    SSL support (#155).

    IPROTO_PUSH messages support (#67).

    Public API with request object types (#126).

    Support decimal type in msgpack (#96).

    Support datetime type in msgpack (#118).

    Prepared SQL statements (#117).

    Streams and interactive transactions support (#101).

    `Call16` method, support build tag `go_tarantool_call_17`
    to choose default behavior for `Call` method as Call17 (#125)

Bugfixes

    Add `ExecuteAsync` and `ExecuteTyped` to common connector
    interface (#62).
oleg-jukovec added a commit that referenced this issue Aug 3, 2022
Overview

This release adds a number of features. The extending of the public API
has become possible with a new way of creating requests. New types of
requests are created via chain calls:

selectReq := NewSelectRequest("space").
             Context(ctx).
			 Index(1).
			 Offset(5).
			 Limit(10)
future := conn.Do(selectReq)

Streams, context and prepared statements support are based on this
idea:

stream, err := conn.NewStream()
beginReq := NewBeginRequest().Context(ctx)
if response, err := stream.Do(beginReq).Get(); err != nil {
    selectFuture := stream.Do(selectReq)
    commitFuture := stream.Do(NewCommitRequest())
    // ...
}
```

Breaking changes

    NewErrorFuture function removed (#190).

    `IPROTO_*` constants that identify requests renamed from
    `<Name>Request` to `<Name>RequestCode` (#126)

New features

    SSL support (#155).

    IPROTO_PUSH messages support (#67).

    Public API with request object types (#126).

    Support decimal type in msgpack (#96).

    Support datetime type in msgpack (#118).

    Prepared SQL statements (#117).

	Context support for request objects (#48).

    Streams and interactive transactions support (#101).

    `Call16` method, support build tag `go_tarantool_call_17`
    to choose default behavior for `Call` method as Call17 (#125)

Bugfixes

    Add `ExecuteAsync` and `ExecuteTyped` to common connector
    interface (#62).
oleg-jukovec added a commit that referenced this issue Aug 4, 2022
Overview

This release adds a number of features. The extending of the public API
has become possible with a new way of creating requests. New types of
requests are created via chain calls:

selectReq := NewSelectRequest("space").
             Context(ctx).
			 Index(1).
			 Offset(5).
			 Limit(10)
future := conn.Do(selectReq)

Streams, context and prepared statements support are based on this
idea:

stream, err := conn.NewStream()
beginReq := NewBeginRequest().Context(ctx)
if response, err := stream.Do(beginReq).Get(); err != nil {
    selectFuture := stream.Do(selectReq)
    commitFuture := stream.Do(NewCommitRequest())
    // ...
}
```

Breaking changes

    NewErrorFuture function removed (#190).

    `IPROTO_*` constants that identify requests renamed from
    `<Name>Request` to `<Name>RequestCode` (#126)

New features

    SSL support (#155).

    IPROTO_PUSH messages support (#67).

    Public API with request object types (#126).

    Support decimal type in msgpack (#96).

    Support datetime type in msgpack (#118).

    Prepared SQL statements (#117).

	Context support for request objects (#48).

    Streams and interactive transactions support (#101).

    `Call16` method, support build tag `go_tarantool_call_17`
    to choose default behavior for `Call` method as Call17 (#125)

Bugfixes

    Add `ExecuteAsync` and `ExecuteTyped` to common connector
    interface (#62).
oleg-jukovec added a commit that referenced this issue Aug 4, 2022
Overview

This release adds a number of features. The extending of the public API
has become possible with a new way of creating requests. New types of
requests are created via chain calls:

selectReq := NewSelectRequest("space").
             Context(ctx).
             Index(1).
             Offset(5).
             Limit(10)
future := conn.Do(selectReq)

Streams, context and prepared statements support are based on this
idea:

stream, err := conn.NewStream()
beginReq := NewBeginRequest().Context(ctx)
if response, err := stream.Do(beginReq).Get(); err != nil {
    selectFuture := stream.Do(selectReq)
    commitFuture := stream.Do(NewCommitRequest())
    // ...
}
```

Breaking changes

    NewErrorFuture function removed (#190).

    `IPROTO_*` constants that identify requests renamed from
    `<Name>Request` to `<Name>RequestCode` (#126)

New features

    SSL support (#155).

    IPROTO_PUSH messages support (#67).

    Public API with request object types (#126).

    Support decimal type in msgpack (#96).

    Support datetime type in msgpack (#118).

    Prepared SQL statements (#117).

    Context support for request objects (#48).

    Streams and interactive transactions support (#101).

    `Call16` method, support build tag `go_tarantool_call_17`
    to choose default behavior for `Call` method as Call17 (#125)

Bugfixes

    Add `ExecuteAsync` and `ExecuteTyped` to common connector
    interface (#62).
oleg-jukovec added a commit to tarantool/doc that referenced this issue Aug 15, 2022
The patch adds context, streams, SQL, push messages and master
discovery support for connection pool to go-tarantool. It also updates
GitHub starts for Go connectors.

Follows up tarantool/go-tarantool#48
Follows up tarantool/go-tarantool#62
Follows up tarantool/go-tarantool#67
Follows up tarantool/go-tarantool#101
Follows up tarantool/go-tarantool#113
patiencedaur pushed a commit to tarantool/doc that referenced this issue Aug 15, 2022
Resolves #3094 

The patch adds context, streams, SQL, push messages and master
discovery support for connection pool to go-tarantool. It also updates
GitHub starts for Go connectors.

Follows up tarantool/go-tarantool#48
Follows up tarantool/go-tarantool#62
Follows up tarantool/go-tarantool#67
Follows up tarantool/go-tarantool#101
Follows up tarantool/go-tarantool#113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants