-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bind params on queries #189
Conversation
for row in rows.iter() { | ||
extensions.push(row.get(1)); | ||
extensions.push(row.name.as_ref().unwrap().to_owned()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is going to change very soon right? This should probably return json formatted instead of just the name as a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in the cor-526
branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question about the timestamps. Everything else seems good. Thanks for the updates!
time, extension_id, new_extension.vers | ||
); | ||
sqlx::query(&query).execute(&mut tx).await?; | ||
SET updated_at = (now() at time zone 'utc') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use (now() at time zone 'utc')
here (updating version record) and below when we update the extension's updated_at
timestamp, will we have slightly different values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now()
will stay the same within the transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postgres=# begin;
BEGIN
postgres=*# select now();
now
-------------------------------
2023-03-30 19:32:06.570287+00
(1 row)
postgres=*# select now();
now
-------------------------------
2023-03-30 19:32:06.570287+00
(1 row)
postgres=*# commit;
COMMIT
postgres=# select now();
now
-------------------------------
2023-03-30 19:32:23.667648+00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! That's exactly what we want.
now() at time zone 'utc'
from the database in the queries instead of computing time in the webserver