Code Monkey home page Code Monkey logo

lua-resty-couchdb's People

Contributors

paragasu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

enquora

lua-resty-couchdb's Issues

changes to post function undocumented

v4.0
function db.post(self, doc) return request('POST', nil, doc) end

v4.2-2
function db.post(self, path, data) return request('POST', path, data) end

this function now requires a mandatory path parameter, this was changed somewhere between 4.0-0 and 4.2-2 and is not documented.

accessing different databases, overwritten db name

constructs like this always result in overwritten database names since couch:db() overwrites the db name of all "objects".
in the case bellow calling db_one:view() would use "database_2" instead of the defined "database_1".

couchdb = require "resty.couchdb"
config = {...}

cdb_one = couchdb.new(config)
cdb_two = couchdb.new(config)

db_one = cdb_one:db("database_1")
db_two = cdb_two:db("database_2")

db_one:view(...) --will query database_2

is that a bug or a lua "quirk"?
what's the best practice to access different databases from the same script?

Fix global variable requests

writing a global lua variable ('request') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables

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.