Runtime System.Exception when ContextSchemaPath is defined
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- mysql
- Domain
- databases
Research direction
Start with the ContextSchemaPath behavior and the FSharp.Data.Sql.Providers.MySql.findClrType@91-1 stack-trace entry, then reproduce the database operation using the listed steps. Done means a cached schema supports design-time and compile-time use without being loaded during runtime database operations, so the insert no longer raises System.Exception: !.
Written by the indexing model from the issue text.
Description
Description
When the ContextSchemaPath locally cached schema file is defined and present, SQLProvider returns System.Exception: ! when performing database operations at runtime.
Repro steps
-
Generate a local schema file with ContextSchemaPath as described in the documentation
-
Debug the project
-
Perform a database operation. The following exception is raised:
System.Exception: !
at FSharp.Data.Sql.Providers.MySql.findClrType@91-1.Invoke(String _arg1)
at FSharp.Data.Sql.Providers.MySql.createParam[a](String name, Int32 i, a v)
at <StartupCode$FSharp-Data-SqlProvider>.$Providers.MySql.clo@350-280.Invoke(Tuple`2 tupledArg)
at Microsoft.FSharp.Collections.SeqModule.Fold[T,TState](FSharpFunc`2 folder, TState state, IEnumerable`1 source)
at FSharp.Data.Sql.Providers.MySqlProvider.createInsertCommand(IDbConnection con, StringBuilder sb, SqlEntity entity)
at <StartupCode$FSharp-Data-SqlProvider>.$Providers.MySql.FSharp-Data-Sql-Common-ISqlProvider-ProcessUpdates@949-3.Invoke(SqlEntity e)
at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc`2 action, IEnumerable`1 source)
at FSharp.Data.Sql.Providers.MySqlProvider.FSharp-Data-Sql-Common-ISqlProvider-ProcessUpdates(IDbConnection con, ConcurrentDictionary`2 entities, TransactionOptions transactionOptions, FSharpOption`1 timeout)
at <StartupCode$FSharp-Data-SqlProvider>.$SqlRuntime.DataContext.f@1-69(SqlDataContext __, IDbConnection con, Unit unitVar0)
at FSharp.Data.Sql.Runtime.SqlDataContext.FSharp-Data-Sql-Common-ISqlDataContext-SubmitPendingChanges()
at MyProject.DoDatabaseStuff(DbRow _row) in C:\Users\Me\Code\MyProject\Db.fs:line 65
Stopped due to error
Expected behavior
The type provider should not attempt to load the ContextSchemaPath at runtime since it is not a data source and will never work. It should only load at design-time and compile-time to allow development and compilation (build server) without a full-time database connection.
Known workarounds
Workarounds are to either not use the ContextSchemaPath at all, or delete the cached schema file each time debugging is needed.
Related information
- Used database: MySQL 5.6
- Operating system Window 10 version 1803
- Branch: 1.1.42
- .NET Runtime: 4.5.2
- Performance information, links to performance testing scripts : N/A
- Dominant language
- F#
- Stars
- 627
- Forks
- 147
- Avg merge
- 2h 2m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fsprojects/SQLProvider
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
fsprojects/SQLProvider#872 · 2 comments ·
-
Repo Assist? Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 10/100
fsprojects/SQLProvider#870 · 1 comment ·
-
postgresql
Difficulty 4/5 3-5 days Newbie friendliness 58/100
fsprojects/SQLProvider#869 · 2 comments ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
fsprojects/SQLProvider#868 · 2 comments ·
-
sql server
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fsprojects/SQLProvider#851 · 1 comment ·
All issues in fsprojects/SQLProvider
Similar issues
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
[BUG] A column whose default is the empty string is drawn in the ER diagram as having no default Openbug database-provider good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
libredb/libredb-studio#1030 · 6 comments ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug redshift
Difficulty 2/5 1-3 hours Newbie friendliness 88/100