-
Notifications
You must be signed in to change notification settings - Fork 32
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
Request for Transaction Support in manticoresearch-php #127
Comments
In theory it's possible as it's supported in the JSON interface. It's just that the BEGIN, ROLLBACK and COMMIT commands have to be executed via the BEGIN + JSON insert + COMMIT:
BEGIN + JSON insert + ROLLBACK:
@rostislav-pn can you give it a shot? If it works, then we probably just need to add dedicated functions instead of sql('BEGIN', true), sql('COMMIT', true) and sql('ROLLBACK', true). |
@sanikolaev can you do that with the mysql client? if so, how do you do that? I tried this but it didn't work:
when I ran this:
it didn't insert the 600 into the products table. when I tried to run it again, this time fixing it and removing the extra underscore, it gave a message: What is the proper syntax for running a transaction and failing all queries in the event something goes wrong? |
just for extra measure I tried to run a transaction that worked on the same index rather than two separate indexes which did not work either. |
If by "all queries" you mean queries to multiple tables - it won't work. The transactions don't support multiple tables. Here's a basic rollback example: mysql> drop table if exists t; create table t(f text); begin; insert into t values(1, 'abc'); rollback; select * from t;
--------------
drop table if exists t
--------------
Query OK, 0 rows affected (0.01 sec)
--------------
create table t(f text)
--------------
Query OK, 0 rows affected (0.00 sec)
--------------
begin
--------------
Query OK, 0 rows affected (0.00 sec)
--------------
insert into t values(1, 'abc')
--------------
Query OK, 1 row affected (0.01 sec)
--------------
rollback
--------------
Query OK, 0 rows affected (0.00 sec)
--------------
select * from t
--------------
Empty set (0.00 sec)
--- 0 out of 0 results in 1ms --- |
Hello,
I'd like to inquire if there are any plans to add transaction support to the manticoresearch-php library in the future, considering that transactions are supported according to the official ManticoreSearch documentation (https://manual.manticoresearch.com/Data_creation_and_modification/Transactions#Transactions). Having this functionality would significantly enhance the capabilities of the library and provide a more convenient way to work with commands like INSERT, REPLACE, and DELETE.
Thank you for the information.
The text was updated successfully, but these errors were encountered: