Giter Site home page Giter Site logo

atlantis-software / offshore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balderdashy/waterline

38.0 38.0 15.0 2.76 MB

An adapter-based ORM for Node.js with support for mysql, mongo, postgres, redis, and more

License: MIT License

JavaScript 100.00%

offshore's People

Contributors

atiertant avatar batornator avatar chotiwat avatar connor4312 avatar corvuscorrax avatar devinivy avatar dmarcelino avatar ghernandez345 avatar globegitter avatar keeganlow avatar khaliltn avatar leedm777 avatar luislobo avatar marionebl avatar marnusw avatar mikehostetler avatar mikermcneil avatar mkeremguc avatar mphasize avatar murilopolese avatar nbiton avatar nkibler7 avatar particlebanana avatar ragulka avatar rogerz avatar sgress454 avatar tjwebb avatar tobalsgithub avatar vanetix avatar zolmeister avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

offshore's Issues

{type: json} and {type:array} primaryKey error

Hi, I've been following the deepPopulate pull req thread on balderdashy, and it's lead me here. I've installed the atlantis-software/waterline#deepPopulate branch, and am using it in place of the one that ships with sails.js, and it works except for when there is a type : "json" or type : "array" attribute in a model, when I then get the error...

this.index(alias, child[this.paths[this.path].children[alias].primaryKey], child);
Cannot read property 'primaryKey' of undefined

I experimented using someone's suggestion on that thread and found that adding the additional test case to the if on line 84 of deepCursor.js...

 if (child && this.paths[this.path].children[alias]) {
    this.index(alias, child[this.paths[this.path].children[alias].primaryKey], child);
 }

and it seems to fixes this. Are you aware of this issue already? I couldn't see anything in the PRs.

Also, a general question. How would I use offshore in place of waterline in a sails project? Can I just point sails at offshore instead of waterline using an npm link or something?

Thanks, Dan

Model validation to ip cause invalid attribute

Hi !
Express can return (with req.ip) ::ffff:127.0.0.1 (or other ipv4 address translated), but it's appear to be invalid with Offshore. ex:

///

module BannedModule {

var time_banned = 3600;

class Class {

  attributes: Object;

  constructor(attr: Object) {
      this.attributes = attr;
  }

  beforeCreate(values, cb: Function) {
      var expires = (new Date().getTime()) + (time_banned * 1000);
      values.expires = new Date(expires);
  }

}

export var model= new Class({

  ip: {
      ip: true,
      required: true,
      unique: true
  },
  reason: {
      type: "string"
  },
  expires: {
      type: "datetime"
  }

});

}

module.exports = BannedModule.model;

Banned.create({ip: req.ip, reason: "weird guy"}).then(console.log).catch(console.log)

ps : sorry for bad style markdown and poor english

continuation of deep populate

Updated documentation on Sails Integration

Can you update the documentation or help me integrate with sails? I would like to use some of the added features to this fork of sails ORM but unsure of how to make this work within the Sails ecosystem.

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.