Closed tforkmann closed 5 years ago
Same thing with the entities in the query definitions:
Are you using dbContect in the same project? I think offline save is not happening across multiple projects.
What version of SQLProvider you use? If you upgrade from earlier than 1.1.49 you may have to re-save the schema path because stored procedures were added to the schema.
This is not duplicate of #552 , right?
I only have one project. And I’m using version 1.1.57. I’m not using stored procedures just normal table mappers. I guess the entities are not save locally?
Only the entity shapes that are used are saved. Not the shape of the whole database.
Ok,
the table is being used and saved in the sql.schema.
But there is no entities of the dbRecord saved.
Is it possible to save those information?
It should save all the entity columns in use (at the time of saving), so you can compile the source code off-line without the database.
It won't save the columns not-in-use, so you can't develop off-line. (You can use the already used columns, but not any new columns.)
So it's kind of a lazy-save. Should work in CI, and when your internet is temporarily down. Is this what you expect, or something else?
Once saved and path added, it's off-line. To re-save, remove the path and save again. I don't know if the editor has to be restarted.
Thank you soo much!
I found my mistake! I didn't saved the context at the end of compile time.
I added the saveContextSchema() at the end of my project and it now works with CI!
Description
Trying to deploy my project to Azure DevOps. I ran into following issue: Once I used the ContextSchemaPath in Offline mode the mapping functions stop working. The dbRecords don't contain the Table elements any more.
Repro steps
Define mappers like described here: https://github.com/fsprojects/SQLProvider/blob/master/docs/content/core/mappers.fsx
Save ContextSchema
Add ContextSchema path to the type definition like that type sql = SqlDataProvider<Common.DatabaseProviderTypes.SQLITE, connectionString, ResolutionPath = resolutionPath, CaseSensitivityChange = Common.CaseSensitivityChange.ORIGINAL, ContextSchemaPath = ContextSchemaPath>
DbRecords are failing because table entitys are not containing the table elements Following Line would crash: https://github.com/fsprojects/SQLProvider/blob/master/docs/content/core/mappers.fsx#L39
Expected behavior
DbRecords should work also in Offline Mode.
Example
Any help would be appreciated!