fix: use timestamp placeholder for postgres compat (#51)

* fix: use timestamp placeholder for postgres compat
---------

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
dni ⚡ 2024-09-03 22:13:51 +02:00 committed by GitHub
commit f912fe29f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -17,7 +17,7 @@ async def create_withdraw_link(
link_id = urlsafe_short_hash()[:22]
available_links = ",".join([str(i) for i in range(data.uses)])
await db.execute(
"""
f"""
INSERT INTO withdraw.withdraw_link (
id,
wallet,
@ -37,7 +37,8 @@ async def create_withdraw_link(
custom_url,
created_at
)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, {db.timestamp_placeholder})
""",
(
link_id,

View file

@ -2,9 +2,15 @@ import datetime
import shortuuid
from fastapi import Query, Request
from lnurl import Lnurl, LnurlWithdrawResponse
# TODO remove type: ignore when 0.12.11 is released
from lnurl import ( # type: ignore
ClearnetUrl, # type: ignore
Lnurl,
LnurlWithdrawResponse,
MilliSatoshi, # type: ignore
)
from lnurl import encode as lnurl_encode
from lnurl.models import ClearnetUrl, MilliSatoshi
from pydantic import BaseModel