I've done some reading and kind of side stepped the issue a bit by adding a
reference to System.Data.SQLite and use that connection object to connect
to the database and pass the connection to the MS SQLite driver. I can now
password encrypt databases and (from my very brief tests) it looks like I
can do the basic insert / updates I wanted to.
For future reference here's the OnConfiguring override in my DbContext.
I've commented out the password code for the moment so I can edit the
database using a tool that doesn't support encryption.
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)
{
SQLiteConnection conn = new SQLiteConnection($"Data
Source={_fileName}");
//conn.Open();
//SQLiteCommand command = conn.CreateCommand();
//command.CommandText = "SELECT QUOTE(@Password);";
//command.Parameters.AddWithValue("@Password", _password);
//string quotedPassword = (string)command.ExecuteScalar();
//command.CommandText = $"PRAGMA {(!File.Exists(_fileName) ?
"rekey" : "key")} = {quotedPassword};"; // rekey sets / changes password
//command.Parameters.Clear();
//command.ExecuteNonQuery();
optionsBuilder.UseSqlite(conn);
}
}
Cheers,
Mike
On Mon, 18 Nov 2019 at 01:24, Joe Mistachkin <[email protected]> wrote:
>
> Mike King wrote:
> >
> > "It needs to be clearly stated somewhere that EF 6.3 is meant only as a
> > tool for migrating from .NET Framework, and that EF Core is the version
> > that should be used." *2
> >
>
> Given the phrasing here, it sounds like this guidance is relatively new
> and/or unofficial at this point?
>
> >
> > <https://docs.microsoft.com/en-us/ef/core/querying/client-eval>. But
> > because it's a new code base, it also lacks some features that EF6 has."
> *3
> >
>
> To clarify, if it lacks features that EF6 has, it sounds a lot less like
> a porting effort and a lot more like a rewriting effort. That does not
> necessarily mean it won't get done (at some point); however, that will
> certainly impact it's relative priority on the roadmap.
>
> --
> Joe Mistachkin
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users