GithubHelp home page GithubHelp logo

Saving the data about couchdb-datasource HOT 19 CLOSED

firebull avatar firebull commented on August 20, 2024
Saving the data

from couchdb-datasource.

Comments (19)

maurymmarques avatar maurymmarques commented on August 20, 2024

I still have not used it with CakePHP 2.4, but I do not know what could have happened to not work.

from couchdb-datasource.

maurymmarques avatar maurymmarques commented on August 20, 2024

I think you need some schema.
Try something like....

class [YourModel] extends AppModel {

    public $schema = array(
        'id' => array(
            'type' => 'string',
            'null' => true,
            'key' => 'primary',
            'length' => 32
        ),
        'rev' => array(
            'type' => 'string',
            'null' => true,
            'key' => 'primary',
            'length' => 34
        )
    )

}

Tell me what happened.
Thank you.

from couchdb-datasource.

firebull avatar firebull commented on August 20, 2024

Same result. I don't really imagine, how to debug it...

from couchdb-datasource.

maurymmarques avatar maurymmarques commented on August 20, 2024

It would be great if someone implements CouchDB output for debug > 1. :)

from couchdb-datasource.

firebull avatar firebull commented on August 20, 2024

Well, debug is 2 in CakePHP. And it's no use to turn debug on in CouchDB as it do not recive any requests =))

from couchdb-datasource.

firebull avatar firebull commented on August 20, 2024

well, I traced model.php
The problem in $schema, so that is correct:

public $schema = array(
        'id' => array(
            'type' => 'string',
            'null' => true,
            'key' => 'primary',
            'length' => 32
        ),
        'rev' => array(
            'type' => 'string',
            'null' => true,
            'key' => 'primary',
            'length' => 34
        ),
        'title' => array(
            'type' => 'string',
            'null' => true,
            'length' => 512
        )
    );

from couchdb-datasource.

maurymmarques avatar maurymmarques commented on August 20, 2024

Great!
I improved this https://github.com/maurymmarques/couchdb-datasource#creating-a-model

As I said, it would be interesting if someone implement CouchDB output to debug > 1, so it would be possible read all GETs, POSTs, PUTs and DELETEs made from application to CouchDB.

Thanks

from couchdb-datasource.

firebull avatar firebull commented on August 20, 2024

I do not really understatnd, what do you want exactly. But I can make a server for you in my cloud so you could test what ever you want for this plugin.

from couchdb-datasource.

maurymmarques avatar maurymmarques commented on August 20, 2024

I mean that when you change the debug to 2 you are able to read the log command sent to MySQL, but there is not a list of log commands sent to CouchDB, that needs to be implemented in the datasource. Do you understand?

from couchdb-datasource.

firebull avatar firebull commented on August 20, 2024

Well, but it is possible to see all commands in CouchDB log, something like this:

- - 'GET' /_all_dbs 200
[Thu, 10 Oct 2013 16:42:29 GMT] [info] [<0.25457.3>] 192.168.2.1 - - 'GET' /spoilers/fa6c2f5c56ed090b50ab5eed0c0033c3 200
[Thu, 10 Oct 2013 16:42:29 GMT] [info] [<0.25458.3>] 192.168.2.1 - - 'GET' /spoilers/fa6c2f5c56ed090b50ab5eed0c0033c3 200
[Thu, 10 Oct 2013 16:42:29 GMT] [info] [<0.25459.3>] 192.168.2.1 - - 'GET' /spoilers/fa6c2f5c56ed090b50ab5eed0c0033c3 200
[Thu, 10 Oct 2013 16:42:29 GMT] [info] [<0.25460.3>] 192.168.2.1 - - 'DELETE' /spoilers/fa6c2f5c56ed090b50ab5eed0c0033c3/?rev=16-8dbc6e0be36ab5356e4bd932882b1f2e 200
[Thu, 10 Oct 2013 16:42:29 GMT] [info] [<0.25461.3>] 192.168.2.1 - - 'GET' /_all_dbs 200
[Thu, 10 Oct 2013 16:42:29 GMT] [info] [<0.25462.3>] 192.168.2.1 - - 'GET' /spoilers/_all_docs?include_docs=true&limit=20 200
[Thu, 10 Oct 2013 16:42:29 GMT] [info] [<0.25463.3>] 192.168.2.1 - - 'GET' /spoilers/_all_docs?include_docs=true 200
[Thu, 10 Oct 2013 18:21:23 GMT] [info] [<0.25464.3>] 192.168.2.1 - - 'GET' /_log 401

from couchdb-datasource.

maurymmarques avatar maurymmarques commented on August 20, 2024

Yes, that is possible, but if there are other processes or other tools running along with the application, it will be difficult to identify what really CakePHP is sending to CouchDB.

from couchdb-datasource.

maurymmarques avatar maurymmarques commented on August 20, 2024

I think it's interesting and not too hard to develop, I'm just too busy, but if someone could help me I would be developing and supporting that.

from couchdb-datasource.

firebull avatar firebull commented on August 20, 2024

Well, I can modify this plugin to use CakeLog http://book.cakephp.org/2.0/en/core-libraries/logging.html#CakeLog

If I do understand write, it is possible to write to a separate log.

from couchdb-datasource.

maurymmarques avatar maurymmarques commented on August 20, 2024

I mean that the log is only displayed to the user, but it should not be persisted.

from couchdb-datasource.

maurymmarques avatar maurymmarques commented on August 20, 2024

I mean something like this https://github.com/cakephp/cakephp/blob/master/lib/Cake/Model/Datasource/DboSource.php#L422

from couchdb-datasource.

firebull avatar firebull commented on August 20, 2024

Ah! =)))) Now I understand =)) Ok, I'll try to do that.

from couchdb-datasource.

maurymmarques avatar maurymmarques commented on August 20, 2024

Those 3 paramters

$this->took = round((microtime(true) - $t) * 1000, 0);
$this->numRows = $this->affected = $this->lastAffected();
$this->logQuery($sql, $params);

But except $numRows that I think it does not make sense to CouchDB.

from couchdb-datasource.

firebull avatar firebull commented on August 20, 2024

OK! I'll check this out in a week, when I will make code for CouchDB in my present project.

from couchdb-datasource.

Oxicode avatar Oxicode commented on August 20, 2024

👍 =)

from couchdb-datasource.

Related Issues (4)

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.