mirror of
https://github.com/knex/knex.git
synced 2026-01-04 02:57:58 +00:00
remove outdated warning message (#4928)
Co-authored-by: Olivier Cavadenti <olivier.cavadenti@gmail.com>
This commit is contained in:
parent
dec8438ed8
commit
5e6b3c2d6a
@ -22,12 +22,6 @@ class QueryCompiler_SQLite3 extends QueryCompiler {
|
||||
|
||||
const { returning } = this.single;
|
||||
|
||||
if (returning) {
|
||||
this.client.logger.warn(
|
||||
'.returning() is not supported by sqlite3 and will not have any effect.'
|
||||
);
|
||||
}
|
||||
|
||||
// The locks are not applicable in SQLite3
|
||||
this.forShare = emptyStr;
|
||||
this.forKeyShare = emptyStr;
|
||||
|
||||
@ -9985,40 +9985,6 @@ describe('QueryBuilder', () => {
|
||||
}).to.throw(Error);
|
||||
});
|
||||
|
||||
it('should warn to user when use `.returning()` function in SQLite3', () => {
|
||||
const loggerConfigForTestingWarnings = {
|
||||
log: {
|
||||
warn: (message) => {
|
||||
if (
|
||||
message ===
|
||||
'.returning() is not supported by sqlite3 and will not have any effect.'
|
||||
) {
|
||||
throw new Error(message);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const sqlite3ClientForWarnings = new SQLite3_Client(
|
||||
Object.assign({ client: 'sqlite3' }, loggerConfigForTestingWarnings)
|
||||
);
|
||||
|
||||
expect(() => {
|
||||
testsql(
|
||||
qb().into('users').insert({ email: 'foo' }).returning('id'),
|
||||
{
|
||||
sqlite3: {
|
||||
sql: 'insert into `users` (`email`) values (?)',
|
||||
bindings: ['foo'],
|
||||
},
|
||||
},
|
||||
{
|
||||
sqlite3: sqlite3ClientForWarnings,
|
||||
}
|
||||
);
|
||||
}).to.throw(Error);
|
||||
});
|
||||
|
||||
it('join with subquery using .withSchema', () => {
|
||||
testsql(
|
||||
qb()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user