-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce69a6c
commit e1438f3
Showing
3 changed files
with
202 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
e1438f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did something simular because i had strange problems on Linux where the wstring is 4byte, and on windows its 2byte. I will check if i need to integrated my changes here to.
But hard to see the change when all brackets changed ;)
I appreciate that development on this did not halt 👍!
e1438f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e1438f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Amin. Excuse me I couldn't find another way to ask you this question. I am actually using your library but it is very slow When I am lauching multiple queries in a for loop.
Is there a way to use "transactions" in your library?
e1438f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one, i have added a constructor that allows you to create an instance from an existing DB handle.
database(sqlite3* db);
Just open youre own handle and open the transaction on it, then construct a Database instance from that handle and enjoy.
e1438f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use transactions with
begin;
,commit;
androllback;
sql commands.(don't forget to put all the semicolons at the end of each query).
But i'm not sure transactions are the reason for your comment :
it is very slow When I am lauching multiple queries in a for loop
.You can create a new issue in https://github.com/aminroosta/sqlite_modern_cpp/issues page.
If you provide a sample code which explains the problem it will be very helpful.
e1438f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're right i did that thing with the other constructor so that i would not have to create an instance of the class for a simple one liner like "BEGIN".
And he's right in regards to the performance, at least for querys that require the disk to write stuff, because SQLite will try to sync with the disk every query. On my SSD it takes ~45 seconds for ~1000 "INSERT"s without a transaction and ~1ms with. Because it will then sync only on the "COMMIT".
e1438f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e1438f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update
README.md
file with this example.It's likely more programmers are not aware of
sqlite transactions
.