Code Monkey home page Code Monkey logo

couchbasedbconnection's Introduction

CouchbaseDbConnection

This is a DbConnection implementation for use with Couchbase (Server or Capella).

Why?

My primary goal was to see how well I could get Dapper working with Couchbase. Why? Because a) I like Dapper a lot, b) I'd like to help other people who also like Dapper to try Couchbase with minimal effort.

What works

When in doubt, check out the tests to see what works.

QueryAsync, ExecuteAsync, ScalarAsync, they all work perfectly fine with primitive values.

What doesn't work

  • ACID Transactions. Couchbase has ACID transactions, but the API doesn't line up very well with the way transactions are implemented.

  • Some date/time stuff. Using C#'s DateTime with JSON strings that contain date/time works fine. DateTimeOffset doesn't seem to work. UNIX timestamp doesn't seem to work.

  • Anything with multiple result sets. Couchbase doesn't support this yet, so it doesn't work.

  • Nested Objects and Arrays of Objects. I can't quite crack this nut. There is a workaround: use JObject and a "shadow" property in C#. It's a little clunky, but it works. You could also just use JObject directly.

  • Non-async. Couchbase .NET SDK is an almost entirely asynchronous library. So, you can't use Query with Dapper, you have to use QueryAsync

I haven't given up hope on these things, but it might be more trouble that it's worth. Let me know in an issue or contact me if you have ideas or really need one of these to work.

What's next

There's a bunch of stuff that's not implemented in CouchbaseDbConnection and the various supporting classes: mainly because my tests with Dapper haven't run into those areas. If you plan to use this with anything except Dapper, please let me know.

I might keep tinkering with this as I get more ideas, or if anyone out there expresses any interest.

After that: writing a better set of tests, creating CI, and publishing a NuGet package.

couchbasedbconnection's People

Contributors

mgroves avatar

Stargazers

 avatar

Watchers

 avatar

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.