Schema Cache Improvements (#5612)
* Cache Improvements * improve tests * more tests * clean-up * test with singlecache * ensure indexes exists * remove ALL_KEYS * Add Insert Test * enableSingleSchemaCache default true * Revert "enableSingleSchemaCache default true" This reverts commit 323e7130fb8f695e3ca44ebf9b3b1d38905353da. * further optimization * refactor enforceFieldExists * coverage improvements * improve tests * remove flaky test * cleanup * Learned something new
This commit is contained in:
@@ -114,6 +114,33 @@ describe_only_db('postgres')('PostgresStorageAdapter', () => {
|
||||
})
|
||||
.catch(done);
|
||||
});
|
||||
|
||||
it('getClass if exists', async () => {
|
||||
const schema = {
|
||||
fields: {
|
||||
array: { type: 'Array' },
|
||||
object: { type: 'Object' },
|
||||
date: { type: 'Date' },
|
||||
},
|
||||
};
|
||||
await adapter.createClass('MyClass', schema);
|
||||
const myClassSchema = await adapter.getClass('MyClass');
|
||||
expect(myClassSchema).toBeDefined();
|
||||
});
|
||||
|
||||
it('getClass if not exists', async () => {
|
||||
const schema = {
|
||||
fields: {
|
||||
array: { type: 'Array' },
|
||||
object: { type: 'Object' },
|
||||
date: { type: 'Date' },
|
||||
},
|
||||
};
|
||||
await adapter.createClass('MyClass', schema);
|
||||
await expectAsync(adapter.getClass('UnknownClass')).toBeRejectedWith(
|
||||
undefined
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe_only_db('postgres')('PostgresStorageAdapter shutdown', () => {
|
||||
|
||||
Reference in New Issue
Block a user