Giter VIP home page Giter VIP logo

Comments (11)

sjlombardo avatar sjlombardo commented on June 27, 2024

Provided that you have compiled SQLCipher with support for loadable extensions, you can use either of the methods described here:

https://www.sqlite.org/lang_corefunc.html#load_extension

from sqlcipher.

dudylan avatar dudylan commented on June 27, 2024

Firstly, thank you for your reply
Secondly, sqlite does have a load_ Extension method.
And I'm using C # references https://github.com/praeclarum/sqlite-net When there is no load_ Extension method. I don't know what to do about it

from sqlcipher.

developernotes avatar developernotes commented on June 27, 2024

Hi @dudylan

In sqlite-net, first you should call EnableLoadExtension, then you can use Execute to call the SELECT load_extension(...) that @sjlombardo linked to.

from sqlcipher.

dudylan avatar dudylan commented on June 27, 2024

Hi @developernotes
image
As shown in the figure, Received the following error

“SQLiteException: not an error“

from sqlcipher.

dudylan avatar dudylan commented on June 27, 2024

image
Similarly, I have also tried this one

from sqlcipher.

developernotes avatar developernotes commented on June 27, 2024

Hi @dudylan,

Sorry, can you try calling ExecuteScalar instead?

from sqlcipher.

dudylan avatar dudylan commented on June 27, 2024

@developernotes Unable to install

I submitted an example

Please take a look

from sqlcipher.

dudylan avatar dudylan commented on June 27, 2024

https://github.com/dudylan/SqliteCheck

from sqlcipher.

developernotes avatar developernotes commented on June 27, 2024

Hi @dudylan,

If you modify your project to include the simple.dll and set 'Copy to output directory' as 'Copy always' for the file, the following modification to your demo will work properly:

var key = "aaa";
var options = new SQLiteConnectionString("xuanyou.db", true, key: key);
var _db = new SQLiteConnection(options);
_db.EnableLoadExtension(true);
var extensionPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "simple.dll");
_db.ExecuteScalar<int>($"SELECT load_extension('{extensionPath}');");
var value = _db.ExecuteScalar<string>("select simple_query('pinyin')");

from sqlcipher.

dudylan avatar dudylan commented on June 27, 2024

Thank you for your answer. I have solved a big problem

from sqlcipher.

developernotes avatar developernotes commented on June 27, 2024

Hi @dudylan,

Great, we're happy to hear that resolved the issue.

from sqlcipher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.