Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 26 2015 20:38

    dmarcelino on v0.10.50

    (compare)

  • Mar 26 2015 20:21

    dmarcelino on master

    Update README.md Added link fo… (compare)

  • Mar 26 2015 20:11

    dmarcelino on master

    Bumped the version to 0.10.50 [… (compare)

  • Mar 26 2015 20:04

    dmarcelino on ci_2.0.4

    (compare)

  • Mar 26 2015 19:43

    dmarcelino on ci_2.0.4

    (compare)

  • Mar 26 2015 19:43

    dmarcelino on sails-orientdb

    (compare)

  • Mar 26 2015 19:42

    dmarcelino on sails-orientdb

    Bumped version to v0.10.50 (compare)

  • Mar 26 2015 19:34

    dmarcelino on master

    Renamed waterline-orientdb -> s… Added Gaurav to package.json; U… Update README.md Added history… and 3 more (compare)

  • Mar 26 2015 19:34

    dmarcelino on sails-orientdb

    (compare)

  • Mar 26 2015 19:34
    dmarcelino closed #70
  • Mar 26 2015 19:19
    dmarcelino synchronize #70
  • Mar 26 2015 19:19

    dmarcelino on sails-orientdb

    Updated code climate repo token (compare)

  • Mar 26 2015 19:17
    dmarcelino opened #70
  • Mar 26 2015 19:15
    dmarcelino closed #69
  • Mar 26 2015 19:09
    gitter-badger opened #69
  • Mar 26 2015 15:24

    dmarcelino on sails-orientdb

    Update FAQ.md [ci skip] (compare)

  • Mar 26 2015 15:17

    dmarcelino on sails-orientdb

    Update README.md Added history… (compare)

  • Mar 26 2015 13:25

    dmarcelino on sails-orientdb

    Renamed waterline-orientdb -> s… Added Gaurav to package.json; U… (compare)

  • Mar 24 2015 20:10

    dmarcelino on v0.10.42

    (compare)

Dário
@dmarcelino
that would be super
Romain Bertrand
@romaintb
i'll do that, and try writing the test myself
thanks for taking a look at it :)
Dário
@dmarcelino
no worries ;)
Romain Bertrand
@romaintb
okay, thanks dmarcelino for bearing with the insane amount of noise I made around this purely fictionnal bug
got to go, have a nice evening
Dário
@dmarcelino
haha, no worries
thanks for the PR
Stefan Wirth
@nafetswirth
hey,
can you guys help me pls?
i have this rather easy query i can't get working with oriento
i basically want to create multiple edges at the same time between one user and other users
#!SQL
create edge friendship from (select from #18:55 where @class = 'user') to (select from user where facebookId in ["123", "456", "789"])
the user id in the first select and the array in the second select will be dynamic - everything works fine in orientdb studio
thanks in advance
Stefan Wirth
@nafetswirth
Okay i think i got i working
var friends = JSON.stringify(friendIds);        
return User.getDB(function(db) {
            return db
                .create('edge', 'friendship')
                .from(userId)
                .where('@class = \'user\'')
                .to(db.select().from('user')
                .where('facebookId in ' + friends))
                .all()
        });
in case anyone needs something like this :D
Dário
@dmarcelino
Hi @nafetswirth, thanks for sharing the solution
Stefan Wirth
@nafetswirth
@dmarcelino
Np mate :)
Mathieu Hamonic
@hammat
Hi guys,
It's possible to create composed index with orientdb but I haven't found more than a unique field in the source code of the adapter.
Have I missed something or it might not be possible yet?
Oh, just got the idea to have a look at waterline and here I am: "Currently Waterline doesn't support multi-column indexes in the attributes definition."
Not an adapter issue, my bad.
Dário
@dmarcelino
Hi @hammat, that is correct, unfortunately it's not supported by waterline yet.
Dário
@dmarcelino

Hi @nafetswirth, I've added a new runFunction method in v0.10.41 which should be less clunky to use. Example:

 Post.runFunction('foo', 'arg1').from('OUser').limit(1).one()
    .then(function(res) {
      console.log(res.foo);  // res.foo contains the result of the function
    });

It returns an Oriento statement object, so from the Post.runFunction('foo', 'arg1') onwards is all oriento syntax. Cheers

Stefan Wirth
@nafetswirth
@dmarcelino nice, thank you
jeswinjames24
@jeswinjames24
Is there any way i can tweak the the sails-lift speed ? btw migrate: 'alter' is working now, but have same slowness as drop
Dário
@dmarcelino
Hi @jeswinjames24, when you say "migrate: 'alter' is working now", have you tried with many-to-many associations? Were the edges intact?
Apart from the unsafeDrop: true I'm really not sure what else we can do from the adapter side...
If you are willing to try waterline master branch, a new migration strategy named create (balderdashy/waterline#846) was added that doesn't drop existing classes. Should be faster and still add classes and properties.
Stefan Wirth
@nafetswirth
hey :)
is there any chance i can use the uuid() function thru the waterline adapter ?
Stefan Wirth
@nafetswirth
id like to avoid succeeding numbers for urls
Dário
@dmarcelino
Hey @nafetswirth, not sure what you mean, can you give an example?
You should be able to add an extra attribute to your models like, e.g.:
    urlSlug : {
      type : 'string',
      required : true,
      index : true,
      unique : true
    },
Dário
@dmarcelino
but it would be up to you to provide the urlSlug value (uuid() or not) when saving and then write the queries to find by urlSlug instead of id
Stefan Wirth
@nafetswirth
id like to use this function http://www.orientechnologies.com/docs/last/orientdb.wiki/SQL-Functions.html#uuid for uuid generation
but i just realised i could do this in the beforecreate hook of the object on the sails server^
@dmarcelino thanks anyway
Dário
@dmarcelino
ah yes, the beforeCreate hook sounds reasonable
don't call it id as in the example though, as id is mapped to @rid
Stefan Wirth
@nafetswirth
i won't :)
Rik
@RXminuS
Is there anything in the works yet for a bit more comprehensive index support...multi key, lucene enigine etc? The current implementation of adding a index field to an attribute is extremely limiting especially since you can't set the index engine. Or is there a way I can add these indexes myself as a hook somewhere in the process? I've been digging through the code but haven't quite gotten my head around the steps yet
Dário
@dmarcelino
Hi @RXminuS, waterline core does not support composite indexes yet (check balderdashy/waterline#109), so single attribute indexes is all we can do for now in waterline-orientdb. For more complex stuff you can use Oriento (example on how to access Oriento instance) or... set them through OrientDB studio.
Regarding the engine index, I've recently added support for "FULLTEXT" (appscot/waterline-orientdb@d2e0049) and I'll be adding more eventually. Feel free to issue a PR if you need it sooner.
Stefan Wirth
@nafetswirth

hey folks,

i was getting a weird error when trying to delete a vertex like this:

    Greeting
    .destroy({location: locationId, _id: greetingId}) ...

with following stacktrace:

 Deleted count [0] does not match rids length [1], some vertices may not have been deleted
  at [object Object].<anonymous> (/Users/herby/hyph_backend/node_modules/waterline-orientdb/lib/collection/vertex.js:57:21)
  at [object Object].tryCatcher (/Users/herby/hyph_backend/node_modules/bluebird/js/main/util.js:24:31)
  at Promise._settlePromiseFromHandler (/Users/herby/hyph_backend/node_modules/bluebird/js/main/promise.js:454:31)
  at Promise._settlePromiseAt (/Users/herby/hyph_backend/node_modules/bluebird/js/main/promise.js:530:18)
  at Promise._settlePromises (/Users/herby/hyph_backend/node_modules/bluebird/js/main/promise.js:646:14)
  at Async._drainQueue (/Users/herby/hyph_backend/node_modules/bluebird/js/main/async.js:79:16)
  at Async._drainQueues (/Users/herby/hyph_backend/node_modules/bluebird/js/main/async.js:89:10)
  at Immediate.Async.drainQueues [as _onImmediate] (/Users/herby/hyph_backend/node_modules/bluebird/js/main/async.js:14:14)
  at processImmediate [as _immediateCallback] (timers.js:358:17)
`

Doing the same thing with oriento worked without probs

just wondering if this might be a bug of the adapter
Oriento version:
Greeting
    .getDB()
    .delete('VERTEX')
    .where({location: locationId, _id: greetingId})
    .limit(1)
    .scalar()
Dário
@dmarcelino
hey @nafetswirth, that weird error message is because of #39, what happens is that waterline expects the adapter to return the deleted objects and currently OrientDB does not allow to delete vertexes/edges and returning what was deleted
so waterline-orientdb tries to do this in 2 steps: first it does a find and then it deletes what was returned by the find
that error messages shows up when the number of deleted records does not match the number of records found by the .find() (first step)
it's hard to say what failed just by the error itself, can you have any kind of concurrent behaviour that would delete those records in between the find and the destroy steps?
if you could write a little test like 06-find_create.js it will be easier to help you
MeloGit
@MeloGit
Hi everybody, i'm trying through associations with 3 tables and one junction table. is it possible?
MeloGit
@MeloGit
This message was deleted
hook (`orm`) failed to load!
bacTypeError: Cannot read property 'throughTable' of undefined
at JoinTables.markCustomJoinTables (E:\sails_projects\BackEnd\node_modules\sails\node_modules\waterline\node_modules\waterline-schema\lib\waterline-sc
hema\joinTables.js:495:89)
at new JoinTables (E:\sails_projects\BackEnd\node_modules\sails\node_modules\waterline\node_modules\waterline-schema\lib\waterline-schema\joinTables.j
s:44:10)
at new module.exports (E:\sails_projects\BackEnd\node_modules\sails\node_modules\waterline\node_modules\waterline-schema\lib\waterline-schema.js:33:17
)
at Waterline.initialize (E:\sails_projects\BackEnd\node_modules\sails\node_modules\waterline\lib\waterline.js:104:17)
at buildWaterlineOntology (E:\sails_projects\BackEnd\node_modules\sails\node_modules\sails-hook-orm\lib\build-waterline-ontology.js:45:19)
at Array.async.auto._buildOntology (E:\sails_projects\BackEnd\node_modules\sails\node_modules\sails-hook-orm\lib\initialize.js:388:7)
at listener (E:\sails_projects\BackEnd\node_modules\sails\node_modules\sails-hook-orm\node_modules\async\lib\async.js:605:42)
at E:\sails_projects\BackEnd\node_modules\sails\node_modules\sails-hook-orm\node_modules\async\lib\async.js:544:17
at _arrayEach (E:\sails_projects\BackEnd\node_modules\sails\node_modules\sails-hook-orm\node_modules\async\lib\async.js:85:13)
at Immediate.taskComplete (E:\sails_projects\BackEnd\node_modules\sails\node_modules\sails-hook-orm\node_modules\async\lib\async.js:543:13)
at processImmediate [as _immediateCallback] (timers.js:383:17) [TypeError: Cannot read property 'throughTable' of undefined]
awaismbajwa
@awaismbajwa
Hello All, Can anyone help me with waterline configuration? I have used waterline in my application and because of that it is showing 100% cpu usage. And this is because there is some database fetching going on in the background, does anyone know how to disable it or reduce it? or if anyone have any other solution, I would be happy to hear. Thanks