Skip to content
This repository was archived by the owner on Jul 11, 2021. It is now read-only.
This repository was archived by the owner on Jul 11, 2021. It is now read-only.

Multiple statements first prepare and then execute #55

@siscia

Description

@siscia

RediSQL support multiple statements in the same "EXEC", hence it is possible and correct to do something like:

REDISQL.EXEC DB "INSERT INTO foo VALUES(1,2,3); INSERT INTO bar VALUES(2,3,4);" 

Which is quite convenient when mixed with BEGIN, COMMIT and ABORT instruction.

One problem is that all the statements are first prepared all together, and then executed, all together.

This works fine in the general case, but has some limitation when to prepare a statement is necessary to have execute the previous one.

This is the case for creating a table and then create an index on that table, or create a second table with references to the first one.

The fix would be to return an iterator when generating the statements, so that each statement is generate only when the previous one is already execute.

Roughly here: https://github.com/RedBeardLab/rediSQL/blob/master/redisql_lib/src/community_statement.rs#L70

However there may be concurrency issues that I have overlooked.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions