Skip to content

Commit

Permalink
feat: use new client
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Jan 7, 2025
1 parent f0f3979 commit d398b88
Show file tree
Hide file tree
Showing 7 changed files with 349 additions and 23 deletions.
15 changes: 15 additions & 0 deletions migrations/1736275393880_stacks-node-event-sequence-id.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable camelcase */

exports.shorthands = undefined;

exports.up = pgm => {
pgm.addColumn('event_observer_requests', {
sequence_id: {
type: 'string'
}
});
};

exports.down = pgm => {
pgm.dropColumn('event_observer_requests', 'sequence_id');
};
292 changes: 285 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"@fastify/swagger": "8.15.0",
"@fastify/type-provider-typebox": "4.0.0",
"@hirosystems/api-toolkit": "1.6.2",
"@hirosystems/salt-n-pepper-client": "0.1.0",
"@scure/base": "1.1.1",
"@sinclair/typebox": "0.32.35",
"@stacks/common": "6.10.0",
Expand Down Expand Up @@ -140,7 +141,6 @@
"postgres": "3.3.1",
"prom-client": "15.1.3",
"rpc-bitcoin": "2.0.0",
"salt-and-pepper-client": "file:../salt-and-pepper/client",
"socket.io": "4.8.0",
"source-map-support": "0.5.21",
"split2": "3.2.2",
Expand Down
7 changes: 7 additions & 0 deletions src/datastore/pg-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4524,4 +4524,11 @@ export class PgStore extends BasePgStore {
`;
if (result.count) return result[0];
}

async getLastEventObserverRequestSequenceId(): Promise<string | undefined> {
const result = await this.sql<{ sequence_id: string }[]>`
SELECT sequence_id FROM event_observer_requests ORDER BY id DESC LIMIT 1
`;
return result[0]?.sequence_id ?? undefined;
}
}
Loading

0 comments on commit d398b88

Please sign in to comment.