using Coravel.Mailer.Mail.Helpers; using Dapper; using Foxnouns.Backend.Database; using Foxnouns.Backend.Database.Models; using Foxnouns.DataMigrator.Models; using NodaTime.Extensions; using Npgsql; namespace Foxnouns.DataMigrator; public static class Queries { public static async Task> GetFediverseAppsAsync(NpgsqlConnection conn) => (await conn.QueryAsync("select * from fediverse_apps")).ToList(); public static async Task> GetUsersAsync(NpgsqlConnection conn, Snowflake minId) => ( await conn.QueryAsync( "select * from users where snowflake_id > @Id order by snowflake_id limit 1000", new { Id = minId.Value } ) ).ToList(); public static async Task> GetUserFieldsAsync(NpgsqlConnection conn) => (await conn.QueryAsync("select * from user_fields order by id")).ToList(); public static async Task> GetMemberFieldsAsync(NpgsqlConnection conn) => (await conn.QueryAsync("select * from member_fields order by id")).ToList(); public static async Task> GetUserProfileFlagsAsync(NpgsqlConnection conn) => (await conn.QueryAsync("select * from user_flags order by id")).ToList(); public static async Task> GetMemberProfileFlagsAsync( NpgsqlConnection conn ) => (await conn.QueryAsync("select * from member_flags order by id")).ToList(); public static async Task> GetUserFlagsAsync(NpgsqlConnection conn) => (await conn.QueryAsync("select * from pride_flags order by id")).ToList(); }