praeclarum / sqlite-net

Simple, powerful, cross-platform SQLite client and ORM for .NET
MIT License
4.07k stars 1.42k forks source link

No SQLiteDataAdapter class parallel to system.data.sqlite #1187

Open vissharm opened 1 year ago

vissharm commented 1 year ago

@praeclarum No SQLiteDataAdapter class parallel to system.data.sqlite. How I migrate old code to your code with sqlcipher new encryption

vissharm commented 1 year ago

@praeclarum Please reply soon... some critical failures as i blocked due to this. SEE is no longer supported (packages not available), so i want to encryt db using sqlcipher and then use your library to read encrypted database. But the older code uses, SQLiteDataAdapter which seems to not available in your package. I have removed system.data.sqlite post referring your package.

ericsink commented 1 year ago

If you're switching from system.data.sqlite, then going to Microsoft.data.sqlite would be an easier change, since both are ADO.NET-style.

vissharm commented 1 year ago

@ericsink which open source encryption and library i could use??? encryption should be strong as data is sensitive and i should be able to work with vb.net existing code which was using system.data.sqlite. I decrypted the old db and now it has no encryption. I need to encrypt it and use some new library which help me reading and updating datasets using dataadapters (existing code).

vissharm commented 1 year ago

Microsoft.data.sqlite , i think does not support sqlitedataadapters and no encryption support. correct me if i am wrong.

vissharm commented 1 year ago

@ericsink Also, it's legacy 4.6.1 dotnet framework.. i want to use netstandard 2.0 compatible package to support future migration plans to dotnet core. microsoft.data.sqlite seems to be unavailable for legacy dotnet frameworks

ericsink commented 1 year ago

I don't know about the data adapters.

Microsoft.Data.Sqlite uses SQLitePCLRaw, which I maintain. You can use SQLCipher. The best way is to purchase builds from Zetetic, as they have packages which are compatible with Microsoft.Data.Sqlite. I also provide builds of sqlcipher with SQLitePCLRaw, but they are unofficial and unsupported.

ericsink commented 1 year ago

Ah, yes, I think you're correct that Microsoft.Data.Sqlite does not support net461 anymore.

vissharm commented 1 year ago

@ericsink my free options then?

ericsink commented 1 year ago

"my free options then?"

I don't know.

vissharm commented 1 year ago

@ericsink do you have examples of SQLitePCLRaw with vb.net/c# for opening encrypted sqlite dbs? netstandard 2.0 package should work fine with 4.6.1. I hope you provide that...

vissharm commented 1 year ago

@ericsink sorry i missed that, microsoft.data.sqlite also target netstandard 2.0 , so it should work with 4.6.1 but issue is lack of data adapter support and encryption (or might be i am not able to get that or do it with open source option available)

ericsink commented 1 year ago

SQLitePCLRaw is a very low-level wrapper. It basically projects the native C API into C#.

vissharm commented 1 year ago

Any idea, how can i replace SEE extension as i have to switch to new supported sqlite packages which should be platform dependent from future dotnet core migration perspective. I will encrypt and work with the existing code with any available opensource option if it provides some strong encryption like SEE.

@ericsink @praeclarum

vissharm commented 1 year ago

@ericsink - Share unsupported, open-source build of SQLCipher, which i can use to encrypt the db file.

vissharm commented 1 year ago

also any gui tool post that to open this encrypted file @ericsink

ericsink commented 1 year ago

I still think Microsoft.Data.Sqlite is your best way forward from System.Data.SQLite, because both are ADO.NET. You'd have to deal with the net461 issues and whatever the adapter problem is, etc.

sjlombardo commented 1 year ago

@vissharm - speaking from Zetetic, we also offer an official SQLCipher package which is API-compatible with System.Data.SQLite and also supports net461. However, it's a commercial edition package, so it not free or open source. https://www.zetetic.net/sqlcipher/sqlcipher-ado/

vissharm commented 1 year ago

@ericsink @sjlombardo SQLitePCL.SQLite3Provider_sqlite3() why this is not available from opensource package i.e. SqlitePCLRaw.bundle.e_sqlcipher?

ericsink commented 1 year ago

First of all, this discussion doesn't belong here in this repo anymore. If you have questions about SQLitePCLRaw, please open a discussion in that repo.

I'm not sure I understand your latest question. Are you asking why the e_sqlcipher bundle does not include SQLite3Provider_sqlite3? If so...

The SQLitePCLRaw provider for "sqlite3" is used to reference a SQLite library named "sqlite3", and my unofficial/unsupported SQLCipher builds are not named that. They are named "e_sqlcipher", specifically to avoid naming conflicts with other builds, such as, for example, the official ones from Zetetic.

vissharm commented 1 year ago

@ericsink SQLite3Provider_sqlite3 this method seems to be missing from the latest SqlitePCLRaw.bundle.e_sqlcipher package I am using. It is giving compile error.

vissharm commented 1 year ago

What I mean below was not working.. SQLitePCL.raw.SetProvider(New SQLitePCL.SQLite3Provider_sqlite3())

I also tried below (without above) but it is also failing sqliteconection object creation SQLitePCL.Batteries_V2.Init()

vissharm commented 1 year ago

Apologies for confusing that discussion belongs here... will continue with further questions as per you suggestion... but it would be nice if you could answer these recent queries here.

ericsink commented 1 year ago

ericsink/SQLitePCL.raw#551