You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following can be reproduced by using many stores, but in this example we're using seneca-knex-store against a postgres instance. Before you can run the code, create the racers table:
CREATE TABLE racers (
id VARCHAR(36) NOT NULL,
username VARCHAR(255) NOT NULL,
favorite_car VARCHAR(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE(username)
);
constconfigDB={// some code here}constseneca=Seneca().test().use('promisify').use('entity',{mem_store: false}).use('seneca-knex-store',configDB)awaitseneca.ready()awaitseneca.make$('racers').save$({username: 'Jose',favorite_car: 'Ferrari'})thrownewError('Oops!')awaitseneca.make$('racers').save$({username: 'Leo',favorite_car: 'Lamborghini'})
After running the code, inspection of the database with psql shows that no racers were created, which means the first call to .save$ was not properly awaited on.
Replacing seneca.make$ with seneca.entity does fix this issue, but it would be nice (and less surprising) if seneca.make$ worked as well.
The text was updated successfully, but these errors were encountered:
The following can be reproduced by using many stores, but in this example we're using
seneca-knex-store
against a postgres instance. Before you can run the code, create theracers
table:After running the code, inspection of the database with
psql
shows that noracers
were created, which means the first call to.save$
was not properly awaited on.Replacing
seneca.make$
withseneca.entity
does fix this issue, but it would be nice (and less surprising) ifseneca.make$
worked as well.The text was updated successfully, but these errors were encountered: