biggora / caminte-cli Goto Github PK
View Code? Open in Web Editor NEWCommand line interface for CaminteJS cross-db ORM
Home Page: http://www.camintejs.com/
License: MIT License
Command line interface for CaminteJS cross-db ORM
Home Page: http://www.camintejs.com/
License: MIT License
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]
What calls exports.relations? The one in models.js calls relations without args, therefore no models.
Because of that hooks are not working too
But all the data in database is changed
Hello.
Errors while trying to create models and routes from a mysql dump file:
caminte -V: 1.3.1
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
[ { 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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.