-
Notifications
You must be signed in to change notification settings - Fork 815
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
Add sqlite schema #6648
Open
arzonus
wants to merge
14
commits into
cadence-workflow:master
Choose a base branch
from
arzonus:add-sqlite-schema
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add sqlite schema #6648
Conversation
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
d421186
to
2b79327
Compare
5f7e734
to
cbf6340
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
sqlite
schema has been added. 99.9% is amysql
schema. There is a few differences:0.1
schemas are left, but they were replaced by schemas described incadence/schema.sql
andvisibility/schema.sql
, so they're identical.domain_metadata
table'sid
type has been changed to INTEGER. SQLite doesn't support AUTOINCREMENT for BIGINT.sqlite
plugin has been registered, so should be appeared in all services. However, the methods are not tested yet, it will be done in future. Without adding, schema setup wouldn't have been able to be tested.Why?
SQLite storage will be used in the future as an in-memory replacement for persistence storage. The diff is a part of the project In-Memory Storage.
Previous PRs:
How did you test it?
Unit tests are passed.
There is a new
sqlite
package intools/sql
. The package contains only one testSetupSchema
that callsSetupFromConfig
func to setup schema to in-memory running sqlite db. It tests that all databases schemas (cadence and visibility) can be setup.Unfortunately, I couldn't reuse tests from
clitest
package that were supposed to be used for this case. These tests are subject to be refactored as they were created only formysql
.At the same time, I couldn't reuse
tools/common/schema/test/
package, as it also callssql-tool
that requires to havingconfig.SQL
filled as it's done for Postgres or MySQL. If we need to support SQLite, we will need to refactor the package. Also, the tests don't support other SQL plugins than MySQL, so it also needs to be added.I decided to not focus on this problem, as most of these test cases covering schema updating that it is not critical for SQLite, as it will be used as in-memory storage (or with temporary database files).
We should focus on this problem later, when we will work on the Local Cadence project.
Potential risks
Release notes
Documentation Changes
Detailed Description
No need, as only there are no break changes.
Impact Analysis
Testing Plan
Rollout Plan