Visitar URL original
Does't support SQLite at Linux ARM64 · Issue #2162 · DapperLib/Dapper · GitHub
Skip to content

Does't support SQLite at Linux ARM64 #2162

Open

Description

@index1207

Environment:

OS: Ubuntu 22.04 (QEMU)
Arch: ARM64
.NET SDK version: 8.0

Build

I had build at x86_64 Windows Machine by below command line.

dotnet publish -c Release -r linux-arm64

Libraries

Example Code:

public T QuerySomething<T>(string sql, object param)
{
    return dbConnection.Query<T>(sql, param);
}
...
SqlMapper.AddTypeHandler(new CustomTypeHandler()); // Implemented all interface.
...
QuerySomething<Model>("SELECT * FROM Model WHERE CustomTypeValue=@CustomTypeValue", new { CustomTypeValue = customTypeValue }

System.Data.SQLite.Core

I already installed libsqlite3-dev package. but it requires SQLite.Interop.dll.

Exception:
Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:

System.Data.SQLite.Core with x64 Linux/Windows

No Exceptions.

Microsoft.Data.Sqlite.Core

Exception:
No mapping exists from object type CustomType to a known managed provider native type.

Doesn't work SqlMapper.AddTypeHandler().


Is there a way recommended usage in Linux ARM64?

Activity

  1. mgravell commented on Apr 29, 2025

    @mgravell
    Member

    Anything related to the mysql client not working is a question for the mysql client; in particular anything to do with

    Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies.

    ^^^ is nothing to do with Dapper, and I can't offer guidance.


    For the other question here:

    No mapping exists from object type CustomType to a known managed provider native type.

    I'd need to see a runnable example / repro that I can investigate.

  2. index1207 commented on May 1, 2025

    @index1207
    Author

    Here is the repro code:

    // ERROR:
    static IEnumerable<dynamic> QueryObj<T>(IDbConnection dbConn, string sql, object obj)
    {
        return dbConn.Query(sql, new { Value = obj });
    }
    QueryObj(dbConn, "SELECT * ...", obj);
    
    // SUCCESS:
    static IEnumerable<dynamic> QueryObj<T>(IDbConnection dbConn, string sql, object obj)
    {
        return dbConn.Query(sql, obj);
    }
    QueryObj(dbConn, "SELECT * ...", new { Value = obj});

    The error No mapping exists from object type ... occurs only Microsoft.Data.Sqlite package.
    It works fine in System.Data.SQLite package.

  3. mgravell commented on May 1, 2025

    @mgravell
    Member

    I need to see exactly what you're seeing. The type and value of obj here is unclear, and it really, really matters. This is not a runnable repro. Please show a complete, minimal example that I can use to investigate this.

  4. mgravell commented on May 1, 2025

    @mgravell
    Member

    Also, no <T> is shown, so that won't compile, and the iterator is not iterated, so it won't even do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions