Skip to content

Add SQLite3.status to call sqlite3_status#520

Merged
flavorjones merged 3 commits intosparklemotion:mainfrom
wjlroe:sqlite-status
Apr 16, 2024
Merged

Add SQLite3.status to call sqlite3_status#520
flavorjones merged 3 commits intosparklemotion:mainfrom
wjlroe:sqlite-status

Conversation

@wjlroe
Copy link
Contributor

@wjlroe wjlroe commented Apr 15, 2024

This function is useful for understanding the runtime performance of sqlite.

This is a very thin layer on top of the sqlite3 library's function, so it allows full usage of it from Ruby.

I've tested with ./bin/build-gems and it built fine and the tests passed.

This function is useful for understanding the runtime performance of
sqlite.

This is a very thin layer on top of the sqlite3 library's function, so
it allows full usage of it from Ruby.
@flavorjones
Copy link
Member

@wjlroe Thank you for this contribution!

I've added a commit with some documentation for the method, and tweaked the test, but otherwise this seems great. Thank you!

@flavorjones
Copy link
Member

I've also updated SQLite3.status to make its second argument optional.

@wjlroe
Copy link
Contributor Author

wjlroe commented Apr 16, 2024

@flavorjones Thanks for improving this! It looks like some of the tests are failing because it's returning 0 sometimes, which I was a bit unsure about when I wrote that test - that test might have to do something via sqlite before enquiring about memory to ensure it's non-zero - what do you think?

@flavorjones
Copy link
Member

@wjlroe Yep, I updated the tests to test for >= 0 so they should be OK now!

@flavorjones flavorjones merged commit 6a2f56c into sparklemotion:main Apr 16, 2024
@wjlroe wjlroe deleted the sqlite-status branch April 16, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants