Need help with SQLite

Hey Guys :slight_smile:
I’m a total beginner with Unity and just started my first Project.
For this I need to connect my project to an SQLite database which is already existing local on my computer.
In other Blogs I only find help about connecting it to Android but I am using it to visualize Data in an Oculus Rift environment.
Could one of you please give me an easy “what to do” list how this is done?
Thanks for your answers

Have you looked at the Asset store? There should be some packages which can make this easy for you.
Just make sure they’re not too old (i.e updated recently), and perhaps email the support to make sure they still support the asset.

Otherwise, have you considered a cloud-based database solution like Gamesparks?

SQLite is a native library. You’ll either have to create a wrapper for it or find one from the Asset Store.

https://docs.unity3d.com/Manual/NativePlugins.html

After that it’s basically just a matter of accessing it via the wrapper.

It is part of mono, apparently, at least on some platforms.
For example, this might work:
https://forum.unity3d.com/threads/tutorial-how-to-integrate-sqlite-in-c.192282/
or:
http://answers.unity3d.com/questions/1230539/database-for-kpi-dashboard-in-unity.html

I saw mention of System.Data.SQLite but according to the official site it hasn’t been updated since 2010.

https://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki

You don’t have to create a wrapper, you can use the System.Data library from your Mono folder (its stripped from Unity) which gives you access to lots of generic database stuff you can use to interface with SQLite.

There is information online about how to do this, it’s not as complicated as people make it seem, just takes some tinkering to wrap your head around it like everything else. Other than the setup, it’s not even Unity-specific code.

The 2010 reference is for code by original developer. After 2010 then sqlite took over development.

More information on recent updates can be found here.

https://system.data.sqlite.org/index.html/doc/trunk/www/news.wiki

The download page is located here:

http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

1 Like