Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# Type Providers very very slow build

I'm playing around with Type Providers, specifically the sql entity framework type provider. I'm writing tests against a database that has a LOT of objects, and it's remote so the connection is a little slow. every time i build the project it takes a lot of time, good several minutes for the build to complete.

what am I missing why does the compiler doesn't cache the type information?

P.S. It's even worse with F# interactive....

like image 316
AK_ Avatar asked Jun 18 '13 13:06

AK_


1 Answers

Try using the LocalSchemaFile attribute for the data provider. This points to a .csdl file that is used to generate the types. You can have the type provider update this file by setting the ForceUpdate attribute to true. To run from a cached schema simply set ForceUpdate to false. Here is how I do this with the SqlDataConnection provider, which is very similar to the SqlEntityConnection provider.

type schema = SqlDataConnection< LocalSchemaFile = "Schema.dbml", ForceUpdate = false, ConnectionString = @"Data Source=<insert your connection string here>" >
like image 131
John Atwood Avatar answered Oct 23 '22 20:10

John Atwood