This macro takes a database connection at compile time, inquires about
the schema, and invoke the `table!` macro for you automatically. This is
an early pass, and it doesn't support any types from third party crates,
or custom primary keys (I'm not even 100% sure that it won't error some
of the time on types that we do support).
Right now we're going off of the type name and capitalizing it to find
the right type. I'm unsure if we'd be better off using the OID (and then
the aliases would be `Oid6342 = Array<Json>` or whatever). We do need to
decide that before 1.0, as it'll be a breaking change for third party
crates.
I've had to do some funkiness in our tests, where basically I set up the
schema on a separate database from where our tests run. This is because
our suite assumes that we can rely on the id 1, which means the table
has to be created in that test. I cannot drop the tables before the
tests run, because on nightly I don't have a place to execute code after
compilation finishes.
As such, this doesn't actually make our tests look much cleaner, but
once we refactor to work w/ persistenct schema we should be able to
remove a lot of code.
This introduces syntex as a dependency on stable, which will pre-process
the appropriate files for annotations. We need to document this process
somewhere.
Fixes#15
Wow, so apparently we don't built on stable or beta, not because of the
compiler plugins, but because `For<i32> for i64` isn't on stable, and
`For<i32> for f64` is only on nightly. Additionally, there was a
breaking change in compiler plugins *tonight*, which I've updated for
(and am pointing at a local branch for dependencies until it gets fixed
upstream).
Sorry for the breakage folks, I know it's a pain. Update to tonights
nightly, it's now the only thing we work on, because I don't know how to
make travis go to last nights. We'll be on stable by the end of the
week.
Ok, I mean I knew that our tests wouldn't work yet because I haven't
added syntex, but that's not even the problem. Apparently the *real*
reason we don't work on stable is that `From<i32> for i64` is only
implemented on beta and `From<i32> for f64` is only nightly. I figured
there were reasons I couldn't target stable, but really????