@@ -227,7 +227,7 @@ where
227
227
/// let mut conn: PgConnection = PgConnection::connect("<Database URL>").await?;
228
228
///
229
229
/// sqlx::raw_sql(
230
- /// "CREATE TABLE users(id INTEGER PRIMARY KEY, username TEXT UNIQUE, created_at TIMESTAMP DEFAULT (now())"
230
+ /// "CREATE TABLE users(id INTEGER PRIMARY KEY, username TEXT UNIQUE, created_at TIMESTAMPTZ DEFAULT (now() ))"
231
231
/// )
232
232
/// .execute(&mut conn)
233
233
/// .await?;
@@ -238,7 +238,7 @@ where
238
238
///
239
239
/// // Get the first row of the result (note the `LIMIT 1` for efficiency)
240
240
/// // This assumes the `time` feature of SQLx is enabled.
241
- /// let oldest_user: (i64 , String, time::OffsetDateTime) = sqlx::query_as(
241
+ /// let oldest_user: (i32 , String, time::OffsetDateTime) = sqlx::query_as(
242
242
/// "SELECT id, username, created_at FROM users ORDER BY created_at LIMIT 1"
243
243
/// )
244
244
/// .fetch_one(&mut conn)
@@ -248,7 +248,7 @@ where
248
248
/// assert_eq!(oldest_user.1, "alice");
249
249
///
250
250
/// // Get at most one row
251
- /// let maybe_charlie: Option<(i64 , String, time::OffsetDateTime)> = sqlx::query_as(
251
+ /// let maybe_charlie: Option<(i32 , String, time::OffsetDateTime)> = sqlx::query_as(
252
252
/// "SELECT id, username, created_at FROM users WHERE username = 'charlie'"
253
253
/// )
254
254
/// .fetch_optional(&mut conn)
@@ -257,7 +257,7 @@ where
257
257
/// assert_eq!(maybe_charlie, None);
258
258
///
259
259
/// // Get all rows in result (Beware of the size of the result set! Consider using `LIMIT`)
260
- /// let users: Vec<(i64 , String, time::OffsetDateTime)> = sqlx::query_as(
260
+ /// let users: Vec<(i32 , String, time::OffsetDateTime)> = sqlx::query_as(
261
261
/// "SELECT id, username, created_at FROM users ORDER BY id"
262
262
/// )
263
263
/// .fetch_all(&mut conn)
0 commit comments