@nozbe/watermelondb
Version:
Build powerful React Native and React web apps that scale from hundreds to tens of thousands of records and remain fast
20 lines (15 loc) • 514 B
JavaScript
// @flow
import type { QueryDescription } from '../../QueryDescription'
export const forbiddenError = `Queries with joins, sortBy, take, skip, lokiTransform can't be encoded into a matcher`
export default function canEncodeMatcher(query: QueryDescription): boolean {
const { joinTables, nestedJoinTables, sortBy, take, skip, lokiTransform, sql } = query
return (
!joinTables.length &&
!nestedJoinTables.length &&
!sortBy.length &&
!take &&
!skip &&
!lokiTransform &&
!sql
)
}