Comments (16)
Hey
I agree that some of the functions in dbmigrate should probably be in dbmigrate-lib. It's mostly due to the fact that dbmigrate started as a binary only and some parts of it moved to a lib later on but I didn't move everything. I'll do that over the weekend, should be a simple case of copy/paste and publishing a new release.
from dbmigrate.
I just saw the reason why I didn't move the code to the lib, it has lots of println!
in the middle which you don't want when using as a library. It also uses a print
crate for it which you want even less as a lib
from dbmigrate.
The question is why that is tied to the print
crate in the first place. One could simply return Result
and let the user of the lib handle it appropriately. (For dbmigrate
that would mean using the print
crate)
from dbmigrate.
I guess the migrate macro could be turned into a function into dbmigrate-lib but the others cannot just be changed to a Result
that easily. For example, up
and down
will need to return a Vec<Result<_>>
since it can run many migrations in one go
from dbmigrate.
Any news here? I want to use dbmigrate programmatically but it requires copy\paste from dbmigrate
crate into my project.
from dbmigrate.
I don't use that crate myself but I will merge a good implementation of that issue
from dbmigrate.
Why you stop using it?
but I will merge a good implementation of that issue
You mean that I can contribute with PR?
from dbmigrate.
Why you stop using it?
I don't do anything database related right now with Rust.
You mean that I can contribute with PR?
Yep!
from dbmigrate.
Oh, it requires a lot of refactoring, if I understand correctly?
from dbmigrate.
How can we organize this work so that I don’t do a very large pull request for review at once?
from dbmigrate.
I wrote some code a while back, didn't come around to get it ready for a PR yet. Tested with SQLite and Postgres, but not with MySQL: https://github.com/FSMaxB/dbmigrate/tree/simplify-migration-struct
from dbmigrate.
This relates to #38 which makes it easier to use the library programmatically since you don't need to check for None
-Optionals everywhere.
from dbmigrate.
Yep #38 is a great way to start. After that, the changes should not be THAT big.
from dbmigrate.
I think that we should start with move code with current implementation into lib as much as we can. Right?
Is not sure #38 is relevant here. Could you please explain it?
from dbmigrate.
#38 is just simplifying the code, not strictly required but it makes it easier to think about.
from dbmigrate.
You think that with this refactoring we should not only move code into lib?
from dbmigrate.
Related Issues (20)
- Use error-chain for error handling
- Make it work as a library
- Add features in dbmigrate-lib HOT 2
- Suggestion: Allow command line option to specify how far to migrate HOT 1
- Panics on color unwrap HOT 3
- Allow specifying schema for migration table in postgres HOT 6
- Update dbmigrate-lib mysql version HOT 3
- Support multiple directories for migrations HOT 2
- multiple sql statements in one migration HOT 2
- Feature: programmatic migrations HOT 1
- Add an optional flag to "up" for database creation HOT 1
- Unable to detect OpenSSL version HOT 4
- Update dependencies
- Use savepoints to allow rerun failed scripts HOT 2
- Migration struct can represent many invalid states/duplicates information HOT 2
- linking with `cc` failed: exit code: 1 HOT 3
- Update all drivers + remove error chain
- Publishing a new release HOT 2
- Multiple migrations with the same number HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbmigrate.