Git Product home page Git Product logo

caminte-cli's Issues

Error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/caminte-cli/bin/../templates/Model.ejs'

When I'm trying to init my models, I get this error:

fs.js:558
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/caminte-cli/bin/../templates/Model.ejs'
    at Object.fs.openSync (fs.js:558:18)
    at Object.fs.readFileSync (fs.js:468:33)
    at Object.<anonymous> (/usr/local/lib/node_modules/caminte-cli/bin/caminte:60:14)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:418:7)

Platform: Ubuntu 16.04 amd64, [email protected]

It seems that creation of models from a dump doesn't work

Hello.

Errors while trying to create models and routes from a mysql dump file:

caminte -V: 1.3.1

sql-file: dump.sql

CREATE TABLE IF NOT EXISTS platforms_locations (
id int(11) NOT NULL AUTO_INCREMENT,
platform_id int(11) NOT NULL,
parent_id int(11) NOT NULL,
external_id varchar(255) NOT NULL,
name varchar(255) NOT NULL,
is_active tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (id),
KEY FK_platforms_locations_platforms (platform_id),
CONSTRAINT FK_platforms_locations_platforms FOREIGN KEY (platform_id) REFERENCES platforms (id) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=384 DEFAULT CHARSET=utf8;

caminte -d ./dump.sql

produces errors like (I've added error printing in 'caminte' file):

[ { modelName: 'PlatformsLocations',
tableName: 'platforms_locations',
version: '0.0.1',
created: '2019-02-12T00:32:42.280Z',
fields: [ [Object], [Object], [Object], [Object], [Object] ],
indexes: [ [Object] ],
pkeys: [] } ]
aborting, dump file not found: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at maybeCallback (fs.js:129:9)
at Object.writeFile (fs.js:1159:14)
at write (C:\Users\Dell\AppData\Roaming\nvm\v10.14.2\node_modules\caminte-cli\bin\caminte:745:8)
at C:\Users\Dell\AppData\Roaming\nvm\v10.14.2\node_modules\caminte-cli\bin\caminte:118:21
at C:\Users\Dell\AppData\Roaming\nvm\v10.14.2\node_modules\caminte-cli\lib\sqlparser.js:119:17
at Array.forEach ()
at Object.renderFields (C:\Users\Dell\AppData\Roaming\nvm\v10.14.2\node_modules\caminte-cli\lib\sqlparser.js:93:16)
at C:\Users\Dell\AppData\Roaming\nvm\v10.14.2\node_modules\caminte-cli\bin\caminte:95:27
at Array.forEach ()
at Object. (C:\Users\Dell\AppData\Roaming\nvm\v10.14.2\node_modules\caminte-cli\bin\caminte:94:21)

What am I doing wrong?

Problems with generated model tests

I'm using a mongodb schema.

When I create models with the command caminte -t -m User name:String pass:String email:String and then run the tests, all the assertions found.id.should.equal(id); fail because found.id and id appear to be objects. If I change the assertions to a deep equals like found.id.should.eql(id) they work.

Also, the tests for #find fail unless the test database is manually cleared after every run, because it finds the old records. I'm not sure if that's intended, but it may be nicer to destroyAll before each model test or at least take that into account in the #find test.

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.