fsprojects / fsprojects/FSharp.Data.SqlClient

Allow database metadata to be saved to a local file

Open
#194 18 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
F#
Stars
206
Forks
66
PR merge metrics
No merged PRs in 30d

Description

Would really like it if this were possible; I might be able to contribute if required. I would like the database to be a dependency only during the first build against it on my dev machine; having the database as a hard dependency on the build is a showstopper to using this library for us. Some other type providers allow this via a local schema file argument to the type provider. This helps with CI builds where you may not have access to the database to get the schema from (I.e. I can get it from a local data file instead). It also ensures builds can be repeatable by keeping versions metadata alongside the code.

Type dB = sqlcommandprovider < query, connectionString, LocalSchemaFile = "dbSchema.cache" >
If the file does not exist then use the database and run the query to get the types to be generated else use the file.

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the SqlCommandProvider entry point and how query metadata is fetched and generated; the issue names no files or tests. Trace the proposed LocalSchemaFile flow, then verify that an existing schema file avoids database access while a missing file falls back to the database, producing repeatable builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp, sql
Domain
build-system, databases, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.