Barebones SQLite support

I’ve started on a library for SQLite. It now works for iOS, Android and Fuse Local Preview. I’m not sure it’s usable for live apps yet, but I’m sure it will get there if I or someone else start to use it.

Anyways, here it is:

https://github.com/bolav/fuse-sqlite

Sweet! :smiley:

Looks awesome!

How would I import the library into my project?

Either use the Projects key in your .unoproj file, or copy the files to your project.

So I’d add this to my .unoproj ?

"Projects": [
    "?????"
]

I’d download the GitHub repo and place it where? Then reference it in the Projects key how? Sorry for the ‘newbieness’.

Not newbie. This should be documented. Point to the unoproj of the other file in Projects. Delete MainView.ux if it contains a tag.

Not entirely sure, I’ve got the repo on my desktop and my project is in my documents. Shall I copy the sqlite.unproj to my project directory then put this is my .unoproj :

"Projects": [
    "sqlite.unoproj"
  ]

?

EDIT: This definitely didn’t work haha!

Also when compiled I get this:

Failed to load assembly '/Users/caseywilliams/Desktop/fuse-sqlite-master/SQLiteImpl.CIL.dll': Could not load file or assembly '/Users/caseywilliams/Desktop/fuse-sqlite-master/SQLiteImpl.CIL.dll' or one of its dependencies. The system cannot find the file specified.
/Users/caseywilliams/Desktop/fuse-sqlite-master/SQLiteImpl.CIL.uno(8,30): E0000: 'SQLiteImpl.OpenImpl(string)' is marked as 'extern', but target does not provide an implementation

Sorry about all this! So I just copied the files to a folder within my project and I have pointed my .unoproj to the sqlite one and that is all fine. However these are the errors when I attempt to preview:

Generating code and data
/Users/caseywilliams/Documents/SSMXCBookingIn/SQLite/SQLiteImpl.CIL.uxl(3,11): E0000: Failed to load assembly '/Users/caseywilliams/Documents/SSMXCBookingIn/SQLite/SQLiteImpl.CIL.dll': Could not load file or assembly '/Users/caseywilliams/Documents/SSMXCBookingIn/SQLite/SQLiteImpl.CIL.dll' or one of its dependencies. The system cannot find the file specified.
/Users/caseywilliams/Documents/SSMXCBookingIn/SQLite/SQLiteImpl.CIL.uno(8,30): E0000: 'SQLiteImpl.OpenImpl(string)' is marked as 'extern', but target does not provide an implementation
/Users/caseywilliams/Documents/SSMXCBookingIn/SQLite/SQLiteImpl.CIL.uno(11,28): E0000: 'SQLiteImpl.ExecImpl(string,string)' is marked as 'extern', but target does not provide an implementation
/Users/caseywilliams/Documents/SSMXCBookingIn/SQLite/SQLiteImpl.CIL.uno(14,28): E0000: 'SQLiteImpl.CloseImpl(string)' is marked as 'extern', but target does not provide an implementation
/Users/caseywilliams/Documents/SSMXCBookingIn/SQLite/SQLiteImpl.CIL.uno(17,55): E0000: 'SQLiteImpl.QueryImpl(string,string)' is marked as 'extern', but target does not provide an implementation

Did you compile the DLL?

Try with this, if you didn’t.

https://www.dropbox.com/s/8hhummb1657lgv8/SQLiteImpl.CIL.dll?dl=0

Works perfectly now thankyou very much! Just starting to learn some Uno now so hopefully I might be a bit better soon! Thankyou again, I can see you have contributed loads to this!

Please let me know if you have some feature requests, or if you start using this in a real project, and need some production features. (Error handling ++ :slight_smile: )

Is there anyway I can contact you off forums? If so please email me at: williamshoops96@gmail.com

As I’d like to keep in contact so I can use this in my project, thankyou :slight_smile:

I’m on Fuse’s slack, and you can contact me on github. :slight_smile:

Thanks very much!:slight_smile:

Hi Bjorn,

when trying to run your sqlite project, I get :

Could not load file or assembly ‘Mono.Data.Sqlite, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756’ or one of its dependencies.

I’m on Windows 10, Fuse version 0.9.5, and I’ve already added the DLL from your dropbox. Where am I wrong ?

Thanks Max

Hi Max,

I actually don’t know. I haven’t got a Windows computer at the moment. From what I understand the project needs to have explicit Windows support, which is not what I hoped for. :slight_smile:

I will let you know when I have a time to look at it. If you take a look at test.cs and cil_compile.sh you see what I did to make it work on OSX.

Hi Bjorn,

I have just installed Mono on my windows laptop, and have compiled DLL by myself with cil_compile.sh command to obtain SQLiteImpl.CIL.dll

It compiles the dll without errors, but when starting app, it agains claims mono.data.sqlite is missing.

So have taken mono.data.sqlite.dll from Mono binaries, and copied it to project directory, no joy. Copied it also to /simulator/Local… where I see other dlls, and restarted the app, same error.

No other idea. What I am wondering is if someone else got it working on windows…

When you will have time to test it for windows, please let us know. Thanks a lot Max

Hi Max, I will give it a go on Windows now and let you know what happens.