-
Notifications
You must be signed in to change notification settings - Fork 57
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
Showing
71 changed files
with
12,540 additions
and
2,103 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
12 changes: 12 additions & 0 deletions
12
migrations/message_store_postgres/content_script_version_6.nim
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,12 @@ | ||
const ContentScriptVersion_6* = | ||
""" | ||
-- we can drop the timestamp column because this data is also kept in the storedAt column | ||
ALTER TABLE messages DROP COLUMN timestamp; | ||
-- from now on we are only interested in the message timestamp | ||
ALTER TABLE messages RENAME COLUMN storedAt TO timestamp; | ||
-- Update to new version | ||
UPDATE version SET version = 6 WHERE version = 5; | ||
""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import chronicles, chronos | ||
import | ||
waku/waku_archive_legacy, | ||
waku/waku_archive_legacy/driver as driver_module, | ||
waku/waku_archive_legacy/driver/builder, | ||
waku/waku_archive_legacy/driver/postgres_driver | ||
|
||
const storeMessageDbUrl = "postgres://postgres:test123@localhost:5432/postgres" | ||
|
||
proc newTestPostgresDriver*(): Future[Result[ArchiveDriver, string]] {. | ||
async, deprecated | ||
.} = | ||
proc onErr(errMsg: string) {.gcsafe, closure.} = | ||
error "error creating ArchiveDriver", error = errMsg | ||
quit(QuitFailure) | ||
|
||
let | ||
vacuum = false | ||
migrate = true | ||
maxNumConn = 50 | ||
|
||
let driverRes = | ||
await ArchiveDriver.new(storeMessageDbUrl, vacuum, migrate, maxNumConn, onErr) | ||
if driverRes.isErr(): | ||
onErr("could not create archive driver: " & driverRes.error) | ||
|
||
return ok(driverRes.get()) |
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
Oops, something went wrong.