MySQL GetDataContext uses original DB even after switching connection strings

Open
#501 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
mysql
Domain
databases

Research direction

Start with the ClientDb.GetDataContext call and reproduce the query using the TestA and TestB connection strings from the issue. Trace which database the generated context uses and determine why it remains on TestA; completion requires identifying and fixing the behavior or documenting the required usage.

Written by the indexing model from the issue text.

Description

Hi, what am I missing here? Connection strings in config.yaml.

type ClientDb = SqlDataProvider<Common.DatabaseProviderTypes.MYSQL,ClientConnString,ResolutionPath = ResoPath, 
                                        IndividualsAmount = IndivAmount, UseOptionTypes = UseOptTypes>

let ClientCtx= ClientDb.GetDataContext Config.CfgTestB.Db.ConnectionString

let Staff = ClientCtx.TestA.Staff |> Seq.toArray

The result of the query is from database TestA. I have checked the connection strings for errors.

Same schema databases. DB names are TestA and TestB same schema.

Initial ClientConnectionString is TestA.

Not quite sure as to why this is happening. Any help would be appreciated. Thanks.

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fsprojects/SQLProvider

All issues in fsprojects/SQLProvider

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.