Code Monkey home page Code Monkey logo

Comments (8)

freeekanayaka avatar freeekanayaka commented on May 24, 2024 1

If you use go-sqlcipher you should be able to use dqlite by:

  1. get the sqlcipher code base
  2. apply the dqlite replication patch that I mentioned above to sqlcipher's fork of the sqlite code (you might want to ask them help here as they probably have their own scripts to maintain their fork)
  3. build the sqlite library from the patched sqlcipher (./configure etc)
  4. put the built .so object your library path and build your Go project passing -tags libsqlite3 as build tag, that will make go-sqlcipher use the .so object

If for any reason the dqlite replication patch doesn't apply cleanly, let me know, and I'll see what I can do.

from dqlite.

paulstuart avatar paulstuart commented on May 24, 2024 1

@krzysztofantczak -- any results to share with the project?

from dqlite.

freeekanayaka avatar freeekanayaka commented on May 24, 2024

Hello,

if sqlcipher works with WAL journalling mode (PRAGMA journal_mode=wal), I see no reason why it should not be possible. I didn't look at the sqlcipher patch though, do you have a link to it? They don't seem to publish one.

In any case, you could apply on top of the sqlcipher git tree the replication patch that dqlite depends on, compile and modify the dqlite demo program under testdata/demo.go to use encryption, and see if it works.

from dqlite.

krzysztofantczak avatar krzysztofantczak commented on May 24, 2024

Yes, it works with WAL. As for the other part - no idea. At this moment i'm using it thru https://github.com/xeodou/go-sqlcipher - so... i'm not that much on to low level stuff yet.

from dqlite.

krzysztofantczak avatar krzysztofantczak commented on May 24, 2024

Ok, this is what i have tried so far: https://gist.github.com/krzysztofantczak/6f2816b6206ec7b72bed8af45e6b786a

And that's the result:

error: patch failed: src/pager.c:4103
error: src/pager.c: patch does not apply
error: patch failed: src/pager.h:178
error: src/pager.h: patch does not apply
error: patch failed: src/sqlite.h.in:8503
error: src/sqlite.h.in: patch does not apply
error: patch failed: src/wal.h:38
error: src/wal.h: patch does not apply

from dqlite.

freeekanayaka avatar freeekanayaka commented on May 24, 2024

Yeah that's expected. Maybe I was not clear enough in my previous comment. The sqlcipher code base does not seem to be a normal fork of the sqlite source tree (in that case the dqlite patch should mostly work), they appear to have their own way to get the sqlite source tree and patching it. I don't know the details of how that works, that's why I suggested that you ask the slqcipher guys what's the best way to apply a patch to their sqlite fork. You can for example link the dqlite patch, or even point them to this issue.

from dqlite.

krzysztofantczak avatar krzysztofantczak commented on May 24, 2024

Ok, after some manual changes, i was able to build .so file - with Your patch and sqlcipher code base. Not sure if it will work as expected, but... I'll try to create some test app with it end report my results if You want.

from dqlite.

freeekanayaka avatar freeekanayaka commented on May 24, 2024

Great, let me know.

from dqlite.

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.