Electron100 / butane

An ORM for Rust with a focus on simplicity and on writing Rust, not SQL
Apache License 2.0
84 stars 12 forks source link

Move butane_cli non-cli specific code to a lib #65

Closed jayvdb closed 1 year ago

jayvdb commented 1 year ago

I would like to programmatically run the operations in butane_cli . e.g. make_migration needs to be part of our build process, and ideally be run from within build.rs. This can be done using only butane, however there are a bunch of utilities and struct CliState which need to be duplicated to achieve this.

The simplest approach is to move these to a lib.rs within butane_cli , and document that anything pub in it is very volatile. That way these dont become part of the more stable butane API. We can also use some rustdoc specific attributes to hide them from the crate.io docs, to make it even less likely people will use them without being aware of the risks involved.

This will also make it easier to write tests for the cli.