How to use go-sqlite for android/iOS
I am creating a GO module which will be exported as library for Android/iOS apps (example: .aar for Android). I want to added database operation to this go module and using it in android and ios apps as both supports sqlite. I tried with examples provided. When i use "$go run [filename]" it creates db and runs without any issue. But when I add sqlite example code to my module and export it as '.aar' file (using gomobile bind) and include it in my android project and try to run. i get following error log
I/GoLog: "unable to open database file: no such file or directory": create table foo (id integer not null primary key, name text); delete from foo;
The issue was reported earlier ass well
https://github.com/golang/go/issues/18194#issue-193398369
but no proper solution posted and no information available. please let me know how to use go-sqlite in android devices
What happens if you remove go-sqlite from the picture and simply do a os.Open() with the same file path that you pass to sql.Open() ?
@marco-m I need sqlite for database operation. go-sqlite is working ok my PC (Desktop Application) but getting this error when i try the test program on mobile. I need go-sql working with gomobile
What happens if you remove go-sqlite from the picture and simply do a
os.Open()with the same file path that you pass tosql.Open()?
@marco-m Also "os.Open()" cannot do any DB operations which is why I need sql
@NishchithSP I think the intent was just to determine if the source of the error you are getting is actually SQLite itself, or just some file system issue, like the filepath being wrong, or you not having proper permissions.