[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [local‑first/Schema](https://evolu.dev/docs/api-reference/common/local-first/Schema) › CreateQuery

```ts
type CreateQuery<S> = <R>(queryCallback: (db: Pick<Kysely.Kysely<{ [Table in keyof S]: { readonly [Column in keyof S[Table]]: Column extends "id" ? StandardSchemaV1.InferOutput<(...)[(...)]> : StandardSchemaV1.InferOutput<(...)> | null } & SystemColumns } & {
  evolu_history: {
     column: string;
     id: IdBytes;
     table: keyof S;
     timestamp: TimestampBytes;
     value: SqliteValue;
  };
  evolu_message_quarantine: {
     column: string;
     id: IdBytes;
     table: string;
     timestamp: TimestampBytes;
     value: SqliteValue;
  };
}>, "selectFrom" | "fn" | "with" | "withRecursive">) => Kysely.SelectQueryBuilder<any, any, R>, options?: SqliteQueryOptions) => Query<S, Kysely.Simplify<R>>;
```

Defined in: [packages/common/src/local-first/Schema.ts:136](https://github.com/evoluhq/evolu/blob/49ea8ca499566aba270f8cb601e7f49aa62320f8/packages/common/src/local-first/Schema.ts#L136)