Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Sqlite#63

Merged
shlomi-noach merged 7 commits intomasterfrom
sqlite
Aug 3, 2017
Merged

Sqlite#63
shlomi-noach merged 7 commits intomasterfrom
sqlite

Conversation

@shlomi-noach
Copy link
Collaborator

This branch experiments with sqlite as backend database. It's an ongoing effort in looking for the incompatibilities between MySQL and sqlite.

I'm meanwhile pursuing, brute-force, the transparent transformations of MySQL dialect into sqlite dialect, so as to find out the real changes in semantics and behavior.

@shlomi-noach
Copy link
Collaborator Author

The build will currently fail, as I haven't integrated the go-sqlite3 package inside the source tree.

@theTibi
Copy link

theTibi commented Feb 1, 2017

@shlomi-noach This is going to be great, thanks for this. Let me know if you need an extra hand to test this. I am more than happy if I can help.

@shlomi-noach
Copy link
Collaborator Author

At this time orchestrator works with sqlite backend. I took the brute-force approach for converting MySQL dialect into sqlite3 dialect via regular expressions; I had to rewrite many queries where this was not achievable.

Many of these queries have now been simplified (which is good), and some have been broken into app logic (which is a pity).

The changes in no way suggest a generic translation mysql->sqlite. I just wanted to get warmed up to start testing functionality.

I'm proceeding to back-test that the rewrites work with mysql (I tested each individually, but haven't run a comprehensive check).

@shlomi-noach
Copy link
Collaborator Author

shlomi-noach commented Feb 2, 2017

Will certainly need better testing method for this.

Next on this PR:

  • make the integration tests work on sqlite, locally
  • make the integration tests work on sqlite on janky (our testing suite)

@shlomi-noach
Copy link
Collaborator Author

I've been spending far too many hours on this. Perhaps someone can come up with a magic solution?

This PR is using https://github.com/mattn/go-sqlite3: sqlite wrapping for golang. The package contains a C file which compiles via cgo and is slow to compile (adds some 20-25 seconds compilation time).
A quick local win is to run go install github.com/mattn/go-sqlite3 ; subsequent runs will just use the package found on $GOPATH/pkg/darwin_amd64/github.com/mattn/go-sqlite3.a.

However the problem is this: I wish to incorporate this package under the vendor/ directory of this repository; such that anyone who clones github.com/github/orchestrator gets sqlite3 automatically, no external dependencies.
That also works -- with the problem that go now insists to compile the sqlite3 package every time I issue a go run.... I'm unable to tell go to use a .a package file within my own repository.

I tried:

  • Adding pkg/darwin_amd64/github.com/mattn/go-sqlite3.a in repo path, using go build -pkgdir=pkg/
  • Adding pkg/... under vendor/, under vendor/github.com/mattn/go-sqlite3, under practically any folder I thought would make sense
  • Using binary-only packages

I realize the .a package depends on the exact golang version that compiled it -- it's fine that I would need to compile via cgo once , and that any user would have to do the same once, but having these extra 20-25 seconds for every compilation/run is too painful.
Does anyone have any suggestion?

@shlomi-noach shlomi-noach mentioned this pull request Feb 13, 2017
@shlomi-noach
Copy link
Collaborator Author

merged #75 which solves dependency issue

@shlomi-noach shlomi-noach deployed to production/github-mysqlutil February 16, 2017 06:26 Active
@shlomi-noach shlomi-noach deployed to production/github-mysql1 February 16, 2017 07:08 Active
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql2 February 16, 2017 07:08 Failure
@shlomi-noach shlomi-noach deployed to production/github-mysql3 February 16, 2017 07:08 Active
@shlomi-noach shlomi-noach deployed to production/github-mysql4 February 16, 2017 07:08 Active
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql5 February 16, 2017 07:08 Failure
@shlomi-noach shlomi-noach deployed to production/github-mysql6 February 16, 2017 07:08 Active
@shlomi-noach shlomi-noach deployed to production/github-mysql8 February 16, 2017 07:08 Active
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql9 February 16, 2017 07:08 Failure
@shlomi-noach shlomi-noach deployed to production/orchestrator-mysql7 February 16, 2017 07:09 Active
@shlomi-noach shlomi-noach deployed to production/db-mysql- February 16, 2017 07:09 Active
@shlomi-noach shlomi-noach deployed to production/github-mysqlutil February 16, 2017 07:11 Active
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql1 February 16, 2017 07:11 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql2 February 16, 2017 07:11 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql3 February 16, 2017 07:11 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql4 February 16, 2017 07:11 Failure
@shlomi-noach shlomi-noach requested a deployment to production/github-mysql5 February 16, 2017 07:11 Pending
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql6 February 16, 2017 07:11 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql8 February 16, 2017 07:11 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql9 February 16, 2017 07:11 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/orchestrator-mysql7 February 16, 2017 07:11 Failure
@shlomi-noach shlomi-noach deployed to production/github-mysqlutil February 19, 2017 08:19 Active
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql6 February 24, 2017 15:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql8 February 24, 2017 15:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql9 February 24, 2017 15:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/orchestrator-mysql7 February 24, 2017 15:41 Failure
@shlomi-noach shlomi-noach deployed to production/github-mysqlutil March 6, 2017 06:41 Active
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql1 March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql2 March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql3 March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql4 March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql5 March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql6 March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql8 March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql9 March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/orchestrator-mysql7 March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/db-mysql- March 6, 2017 06:41 Failure
@shlomi-noach shlomi-noach deployed to production/github-mysqlutil March 7, 2017 06:23 Active
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql1 March 7, 2017 06:23 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql2 March 7, 2017 06:23 Failure
@shlomi-noach shlomi-noach had a problem deploying to production/github-mysql3 March 7, 2017 06:23 Failure
@shlomi-noach
Copy link
Collaborator Author

#97 was based on this PR and has been merged.

Now this PR adds:

  • Actually importing github.com/mattn/go-sqlite3
  • Using sqlite3 in tests
  • Including sqlite3 in vendor. That part I'm still looking at. Will examine golang 1.8's plugins.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants