-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e3ce4f
commit f62b086
Showing
9 changed files
with
157 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
packages/node-sdk/paima-db/src/sql/mina-checkpoints.queries.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** Types generated for queries found in "src/sql/mina-checkpoints.sql" */ | ||
import { PreparedQuery } from '@pgtyped/runtime'; | ||
|
||
/** 'UpdateMinaCheckpoint' parameters type */ | ||
export interface IUpdateMinaCheckpointParams { | ||
network: string; | ||
timestamp: string; | ||
} | ||
|
||
/** 'UpdateMinaCheckpoint' return type */ | ||
export type IUpdateMinaCheckpointResult = void; | ||
|
||
/** 'UpdateMinaCheckpoint' query type */ | ||
export interface IUpdateMinaCheckpointQuery { | ||
params: IUpdateMinaCheckpointParams; | ||
result: IUpdateMinaCheckpointResult; | ||
} | ||
|
||
const updateMinaCheckpointIR: any = {"usedParamSet":{"timestamp":true,"network":true},"params":[{"name":"timestamp","required":true,"transform":{"type":"scalar"},"locs":[{"a":71,"b":81},{"a":149,"b":159}]},{"name":"network","required":true,"transform":{"type":"scalar"},"locs":[{"a":88,"b":96}]}],"statement":"INSERT INTO mina_checkpoint(\n timestamp,\n network\n) VALUES (\n :timestamp!,\n :network!\n) \nON CONFLICT (network) DO\nUPDATE SET timestamp = :timestamp!"}; | ||
|
||
/** | ||
* Query generated from SQL: | ||
* ``` | ||
* INSERT INTO mina_checkpoint( | ||
* timestamp, | ||
* network | ||
* ) VALUES ( | ||
* :timestamp!, | ||
* :network! | ||
* ) | ||
* ON CONFLICT (network) DO | ||
* UPDATE SET timestamp = :timestamp! | ||
* ``` | ||
*/ | ||
export const updateMinaCheckpoint = new PreparedQuery<IUpdateMinaCheckpointParams,IUpdateMinaCheckpointResult>(updateMinaCheckpointIR); | ||
|
||
|
||
/** 'GetMinaCheckpoint' parameters type */ | ||
export interface IGetMinaCheckpointParams { | ||
network: string; | ||
} | ||
|
||
/** 'GetMinaCheckpoint' return type */ | ||
export interface IGetMinaCheckpointResult { | ||
timestamp: string; | ||
} | ||
|
||
/** 'GetMinaCheckpoint' query type */ | ||
export interface IGetMinaCheckpointQuery { | ||
params: IGetMinaCheckpointParams; | ||
result: IGetMinaCheckpointResult; | ||
} | ||
|
||
const getMinaCheckpointIR: any = {"usedParamSet":{"network":true},"params":[{"name":"network","required":true,"transform":{"type":"scalar"},"locs":[{"a":54,"b":62}]}],"statement":"SELECT timestamp FROM mina_checkpoint WHERE network = :network! LIMIT 1"}; | ||
|
||
/** | ||
* Query generated from SQL: | ||
* ``` | ||
* SELECT timestamp FROM mina_checkpoint WHERE network = :network! LIMIT 1 | ||
* ``` | ||
*/ | ||
export const getMinaCheckpoint = new PreparedQuery<IGetMinaCheckpointParams,IGetMinaCheckpointResult>(getMinaCheckpointIR); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* @name updateMinaCheckpoint */ | ||
INSERT INTO mina_checkpoint( | ||
timestamp, | ||
network | ||
) VALUES ( | ||
:timestamp!, | ||
:network! | ||
) | ||
ON CONFLICT (network) DO | ||
UPDATE SET timestamp = :timestamp!; | ||
|
||
/* @name getMinaCheckpoint */ | ||
SELECT timestamp FROM mina_checkpoint WHERE network = :network! LIMIT 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters