javascript - What is the difference between createTable(...).createTable(...) and createTable(...).then(...) in knex.js? -
i using knex.js connect mysql database. want create couple of tables. far, have seen 2 styles. 1 of them chains use of createtablelike so,
knex.schema.createtable('foo',function(table){...}).createtable('bar'...) the other style uses then mechanism same thing.
knex.schema.createtable('foo',function(table){...}).then(function() { knex.schema.createtable.createtable('bar'...) are semantically similar? can assume same thing? both of them execute second clause once first clause finishes?
i think comment should enough answer,
then in javascript returns promise executed asynchronously, while other method executed synchronously , javascript won't next line until line executed.
Comments
Post a Comment