Skip to content

Update content/core/sqlite.fsx with Quick Start #840

Open
@johnW-ret

Description

@johnW-ret

There seem to be quite a few open issues regarding using SQLProvider with SQLite regarding dependencies and DLLs.

I understand that possibilities alone of just

   fsi | fsproj | Polyglot Notebook
   *
   net46 | net8+
   *
   Microsoft.Data.Sqlite | System.Data.SQLite | Mono.Data.SQLite

is quite a lot before you even begin talking about versions, copying dlls, local environments, etc.

However, could we get an addition or rewrite of sqlite.fsx to have a quick-start for a net9 console app?

My particular issue is that I have copied Microsoft.Data.Sqlite.dll and e_sqlite3.dll to my ResolutionPath, and when I exclude SQLitePCLRaw.core.dll, I get ... Could not load file or assembly 'SQLitePCLRaw.core, Version=2.1.2.1721, but when I include it I get You need to call SQLitePCL.raw.SetProvider(). If you are using a bundle package, this is done by calling SQLitePCL.Batteries.Init(). (Docs do not address (?) what to pass to SetProvider and Init does nothing).

In my case though, I don't really care whether I use Microsoft.Data.Sqlite or System.Data.SQLite. I've gotten SQLProvider to work in a notebook but now I can't replicate it. Getting every scenario perfectly working for everyone will probably always be hard to iron out but FSharp.Data is dead simple and I would appreciate having / being able to contribute to an easy onboarding devex for the simple fsproj * net9 * <whatever is easiest> use case and go from there.

As a side note, I am using Ionide, but I am reporting on the output of the dotnet build command. I can figure out tooling once I get this to even compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions