dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 379 forks source link

Creating a model with no additional fields fails #599

Open weswigham opened 9 years ago

weswigham commented 9 years ago

In version 2.1.20, creating a model like so does not function:

var orm = require('orm');

orm.connect({protocol: 'sqlite', database: 'test.sqlite'}, function(err, db) {
  if (err) throw err;

  var User = db.define('users', {}, {});
  User.create({}, function(err, result) {
    if (err) throw err;
    assert(result);
  });
});

(I mean to say an object with no columns beyond the autogenerated id column)

Specifically, it fails with a SQL syntax error (Error: SQLITE_ERROR: near ")": syntax error) when you attempt to create an instance of the object. (as indicated on line 8 of the above)

benkantor commented 9 years ago

+1

computermatt commented 9 years ago

+1

mrm9084 commented 9 years ago

++

ZMYaro commented 9 years ago

+1