"Owner" param not working for PostgreSQL.

Open
#400 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fsharp, postgresql
Domain
databases

Research direction

Start with the supplied SqlDataProvider reproduction using PostgreSQL and Owner="backoffice"; the issue provides no source file or test to locate first. Trace the type-provider entry point and existing PostgreSQL owner handling, then verify that the reproduction no longer reports FS3028 and resolves the requested owner.

Written by the indexing model from the issue text.

Description

postgresql
Description

The Owner parameter for the connecting to PostgreSQL doesn't seem to work and results in an error.

Repro steps

Connect to a PostgreSQL database like so:

    let [<Literal>] resPath = __SOURCE_DIRECTORY__ + @"..\..\packages\Npgsql.3.1.0\lib\net45\"
    let [<Literal>] dbVendor = Common.DatabaseProviderTypes.POSTGRESQL

    type dbCon = 
        SqlDataProvider<DatabaseVendor = dbVendor,
                        ConnectionString = dbConStr,
                        ResolutionPath = resPath,
                        UseOptionTypes = false,
                        Owner = "backoffice">

    let db = dbCon.GetDataContext()
Actual behavior

I get the following error:

Error	FS3028	The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Expected provided type named 'SqlDataProvider,DatabaseVendor="2",ConnectionString="Host=xxx; Database=xxx; Username=xxx; Password=xxx; ApplicationName=xxx; MinPoolSize=4; MaxPoolSize=10; Timeout=60; CommandTimeout=600",ResolutionPath="C:\\Users\\xxx\\packages\\Npgsql.3.1.0\\lib\\net45\\",Owner="backoffice"' but provided type has 'Name' with value 'SqlDataProvider,DatabaseVendor="2",ConnectionString="Host=xxx; Database=xxx; Username=xxx; Password=xxx; ApplicationName=xxx; MinPoolSize=4; MaxPoolSize=10; Timeout=60; CommandTimeout=600",ResolutionPath="C:\\Users\\xxx\\packages\\Npgsql.3.1.0\\lib\\net45\",Owner=\"backoffice"'	xxx	C:\Users\xxx\Desktop\xxx\Library1.fs
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.