Search Unity

Question SQLite database loaded (Maybe) but can't use functions in 2021.3.25 LTS

Discussion in 'Scripting' started by NameofaUser, May 29, 2023.

  1. NameofaUser

    NameofaUser

    Joined:
    Nov 23, 2022
    Posts:
    1
    I've been trying to use SQLite within my project for a Windows build using 2021.3.25 LTS.

    I have followed this tutorial, but instead copied the Mono.Data.Sqlite.dll from the unityjit-windows folder into a Asset/Plugins folder. In addition to this, I have download the sqlite3.dll and sqlite3.def from the sqlite website (64-bit windows binary version).



    It appears that the DLL is being found and I can call it with "using Mono.Data.Sqlite;".

    The problem is that when I try to use any function from within it (eg. SqliteConnection()), I get a CS0246 error - the type or namespace could not be found. Even the example code from the tutorial isn't able to run. Intellisense also has no idea what any of these functions are and do not turn blue when used.

    Is there anything that I am missing here? I have tried some of the other Mono.Data.Sqlite files with no luck.

    Thanks in advance.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,702
    Not sure how much luck you'll have integrating mainline Windows packages.

    I've always stuck with stuff made for Unity as Unity is sort of its own little ecosystem in gameland.

    I used this a few years back for Android and iOS:

    https://github.com/codecoding/SQLite4Unity3d

    There's also a bunch of stuff on the Unity Asset Store for SQL and SQLite searches.