feat: split migration into batches
This commit is contained in:
parent
d518cdf739
commit
80385893c7
7 changed files with 104 additions and 7 deletions
|
@ -13,8 +13,13 @@ public static class Queries
|
|||
public static async Task<List<GoFediverseApp>> GetFediverseAppsAsync(NpgsqlConnection conn) =>
|
||||
(await conn.QueryAsync<GoFediverseApp>("select * from fediverse_apps")).ToList();
|
||||
|
||||
public static async Task<List<GoUser>> GetUsersAsync(NpgsqlConnection conn) =>
|
||||
(await conn.QueryAsync<GoUser>("select * from users order by id")).ToList();
|
||||
public static async Task<List<GoUser>> GetUsersAsync(NpgsqlConnection conn, Snowflake minId) =>
|
||||
(
|
||||
await conn.QueryAsync<GoUser>(
|
||||
"select * from users where snowflake_id > @Id order by snowflake_id limit 1000",
|
||||
new { Id = minId.Value }
|
||||
)
|
||||
).ToList();
|
||||
|
||||
public static async Task<List<GoUserField>> GetUserFieldsAsync(NpgsqlConnection conn) =>
|
||||
(await conn.QueryAsync<GoUserField>("select * from user_fields order by id")).ToList();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue