query store
This commit is contained in:
parent
7ca51c3670
commit
6b7b5a99d6
9 changed files with 36 additions and 8 deletions
|
@ -1,10 +1,13 @@
|
|||
import { DynamicQueryStructure } from "../type/dynamicQueries";
|
||||
|
||||
export interface CreateQueryStoreCommand {
|
||||
query: string;
|
||||
title: string;
|
||||
query: string | DynamicQueryStructure;
|
||||
}
|
||||
|
||||
export interface UpdateQueryStoreCommand {
|
||||
id: number;
|
||||
query: string;
|
||||
query: string | DynamicQueryStructure;
|
||||
}
|
||||
|
||||
export interface DeleteQueryStoreCommand {
|
||||
|
|
|
@ -15,7 +15,9 @@ export default abstract class QueryStoreCommandHandler {
|
|||
.insert()
|
||||
.into(query)
|
||||
.values({
|
||||
query: createQueryStore.query,
|
||||
title: createQueryStore.title,
|
||||
query:
|
||||
typeof createQueryStore.query == "string" ? createQueryStore.query : JSON.stringify(createQueryStore.query),
|
||||
})
|
||||
.execute()
|
||||
.then((result) => {
|
||||
|
@ -36,7 +38,8 @@ export default abstract class QueryStoreCommandHandler {
|
|||
.createQueryBuilder()
|
||||
.update(query)
|
||||
.set({
|
||||
queryStore: updateQueryStore.query,
|
||||
query:
|
||||
typeof updateQueryStore.query == "string" ? updateQueryStore.query : JSON.stringify(updateQueryStore.query),
|
||||
})
|
||||
.where("id = :id", { id: updateQueryStore.id })
|
||||
.execute()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue