Skip to content
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

Attempt to implement an in-memory store using SQLite #147

Merged
merged 46 commits into from Jan 8, 2021

Conversation

k00ni
Copy link
Collaborator

@k00ni k00ni commented Dec 22, 2020

What?

This PR contains code for an in-memory store which uses PDO + SQLite (:memory:). Because it is based on existing classes it provides the same functionality as its MySQL based pendant.

I also extended PHP-CS-Fixer coverage and improved code readability overall.

Details

  • PDOAdapter class got another check to make sure it is only used with mysql protocol.
  • Adapted classes like ARC2_Store to distinguish between MySQL and SQLite approaches
  • ARC2_StoreLoadQueryHandler::checkSQLBuffers: removed fourth parameter, because it is unused inside the function
  • ARC2_StoreSelectQueryHandler::getTempTableDef: renamed it to getTempTableDefForMySQL and added a second version for SQLite (called getTempTableDefForSQLite)
  • reworked Github Actions to test the library (focused on simplifications and clear code)
  • fixed coding styles in further files to improve code readability
  • removed further instances of the error control operator @, e.g. @include_once (suppressing errors is bad coding style because you might not see when something went wrong)
  • improved README.md (shows test cases, added in-memory example)
  • added test coverage for MySQL 5.5

Ref: #105

@k00ni k00ni added enhancement store Related to the RDF store. labels Dec 22, 2020
@k00ni k00ni self-assigned this Dec 22, 2020
* prepered basic classes
* copied ARC2_StoreTableManager to provide create table
  functions for SQLite instead
+ moved Adapter tests to tests/integration
+ removed further @'s before functions
because it fails local but not in CI
only failures left
to see why SQLite tests are failing
@k00ni k00ni marked this pull request as ready for review December 28, 2020 16:24
@k00ni
Copy link
Collaborator Author

k00ni commented Dec 28, 2020

We have an in-memory store now! 🚀

Added a small section to README.md about the new store: https://github.com/semsol/arc2/tree/pr/sqlite-in-memory-store#in-memory-store-sqlite-based

@semsol (or should I use @bnowack from now on?): What do you think? I know there are many changes, but if you could take a look at SQLite related changes in store/. My approach was to keep what you've built and add some if-clauses, in case SQL differs between MySQL and SQLite. Thanks in advance.

@k00ni
Copy link
Collaborator Author

k00ni commented Dec 28, 2020

@zozlak: What do you think about a standalone library providing an in-memory triple store? It could be based on this code here, using SQLite with :memory:.

@k00ni k00ni requested review from bnowack and semsol December 28, 2020 19:24
@zozlak
Copy link

zozlak commented Dec 29, 2020

What do you think about a standalone library providing an in-memory triple store? It could be based on this code here, using SQLite with :memory:.

I think there are many things to discuss here but I would be glad to talk with you about it. I propose you contact me by email not to spam here too much.

@bnowack
Copy link
Collaborator

bnowack commented Dec 29, 2020

Wow! how cool is that?

@k00ni k00ni merged commit 586f303 into master Jan 8, 2021
@k00ni k00ni deleted the pr/sqlite-in-memory-store branch January 8, 2021 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement store Related to the RDF store.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants