Is it possible to use database schema?
Using a migration file is nice with code-first. But, is it possible to automatically map the data structure by targeting a database?
I mean, all you need is a connection string and it will detect all your db objects (tables, views, stored procedures, etc...). What do you think?
Rezoom.SQL is really biased towards situations where you're making the database to serve your app, not dealing with an existing database. I agree that there are plenty of times where you don't want to be the owner of the database migrations (or perhaps you do, but you still have some nonzero starting point).
Right now this use case is best served by the other F# ORMs: https://github.com/fsprojects/FSharp.Data.SqlClient and https://github.com/fsprojects/SQLProvider
For Rezoom.SQL, I think the best approach to this would be to write little console apps for each backend that can generate a V1.model.sql from a connection string. This should be feasible for at least SQLite (I already have a SQLite parser which could be used to parse object definitions) and T-SQL (I think using the sys tables might be enough to get a rough idea of the schema). Presumably something can be done for Postgres as well since SQLProvider supports it.
@rspeele I was thinking about Sql Server but of course, if it can be generic, it could be even more useful.
In the case of Sql Server, what if we can use the sys schema as the starting point, querying Tables, Columns, StoredProcedures and everything that is used in Rezoom.Sql. From that, you get all the metadata structured and usable without having anything to do. or maybe the other difficulty would be to refresh the structure when an object changed in the database, that's another challenge.