Comments (12)
@kaplanelad yeah on it
from loco.
Can I pick this issue?
from loco.
@jondot maybe we can fix the seaorm cli crate and make the generator entry to use via the crate instead of the cli installation?
what do you think?
from loco.
the crate is a bit heavy, and at this stage it would require efforts to maintain -- because we would need to duplicate their code into our project manually every time right? i don't remember if this is still the case.
regardless -- we may also need to pin to a specific sea-orm-cli version, because I suspect different versions produce different results
from loco.
The problem is that the sea-orm is needed only on specific templates (saas).
We could do something smarter and check in the lib that:
Check if the user uses the DB feature and the migration commands in the configuration are enabled (migration, truncate, reset..) and then check if seaorm-cli is installed. and if not, stop the service and prompt a pretty message.
What do you think?
from loco.
yes sounds good!
from loco.
@AbhilashGade you can feel free and take it.
you can implement it in the lib instead of the CLI.
see that the validation should be only when with-db
feature is enable
let me know if your needs some help. i would like to assists if you needs
from loco.
@kaplanelad yeah on it
just make sure that you not installing automatically sea-orm. i think it is better to return an pretty error with explanation
from loco.
Okay how do I test this
from loco.
@AbhilashGade you can use (check_seaorm_cli)[https://github.com/loco-rs/loco/blob/master/src/doctor.rs#L132] which doing the checks that you needs
from loco.
So do I do something like this
fn check_sea_orm() {
println!("π πSeaORM is not installed. SeaORM is a powerful ORM for Rust that provides convenient database abstractions. It is required for this feature. Would you like to install it? (y/n)");
let mut input = String::new();
std::io::stdin().read_line(&mut input).unwrap();
let input = input.trim().to_lowercase();
if input == "y" || input == "yes" {
println!("Installing SeaORM... π π");
std::process::Command::new("cargo")
.arg("install")
.arg("sea-orm")
.output()
.expect("Failed to install SeaORM");
} else {
println!("SeaORM is required for this feature. Please install it to continue.");
}
}
from loco.
@kaplanelad yeah on it
just make sure that you not installing automatically sea-orm. i think it is better to return an pretty error with explanation
Did you see my previous message? I believe there's no need to install the sea-orm-cli. Handling the installation process might be unnecessary and open to potential problems.
Prompting the user with the necessary details should suffice.
You can take a look at this PR: #212. if you think we can to it better or prettier you are more then welcome to advise
from loco.
Related Issues (20)
- SeaORM SQLite types are now non lossy HOT 3
- Add ARCHITECTURE.md to generated templates HOT 1
- Replace Redis with Valkey (or other alternatives) HOT 2
- Extensibility of AppContext HOT 3
- Cron/Scheduler support? HOT 6
- Adding `ilike` to model query dsl HOT 4
- docs: build a "rosetta stone" for frameworks vs "how its done in Loco"
- loco-cli doesn't have the subcommand "generate" HOT 2
- Plural naming system doesn't work for atypical plurals HOT 2
- Add section: "Loco in production", and include tips about Rust default allocators (malloc) and memory after heavy loading HOT 4
- "ActiveCache" subsystem for streamlined cache service in Loco
- "ActiveData" subsystem: enable seamless and strongly typed loading of static data for an app
- Add Error processing hook HOT 3
- Getting Started section of guide has commands that do not work as expected HOT 4
- When I use loco, the following error is too common. what reason? HOT 9
- Guest blog posts HOT 4
- Add RequestContext, and support request-scoped sessions
- add `production.yml` to `.gitignore` by default
- Add information section to documentation about order of extractors mattering HOT 3
- _ping and api/_pingοΌ 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 loco.