@@ -92,7 +92,10 @@ public static QuerySql WithTransaction(MySqlTransaction transaction)
9292 return null ;
9393 }
9494
95- private const string ListAuthorsSql = "SELECT id, name, bio FROM authors ORDER BY name LIMIT @limit OFFSET @offset" ;
95+ private const string ListAuthorsSql = @"SELECT id, name, bio
96+ FROM authors
97+ ORDER BY name
98+ LIMIT @limit OFFSET @offset" ;
9699 public readonly record struct ListAuthorsRow ( long Id , string Name , string ? Bio ) ;
97100 public readonly record struct ListAuthorsArgs ( int Limit , int Offset ) ;
98101 public async Task < List < ListAuthorsRow > > ListAuthors ( ListAuthorsArgs args )
@@ -256,7 +259,8 @@ public async Task<long> CreateAuthorReturnId(CreateAuthorReturnIdArgs args)
256259 return null ;
257260 }
258261
259- private const string GetAuthorByNamePatternSql = "SELECT id, name, bio FROM authors WHERE name LIKE COALESCE(@name_pattern, '%')" ;
262+ private const string GetAuthorByNamePatternSql = @"SELECT id, name, bio FROM authors
263+ WHERE name LIKE COALESCE(@name_pattern, '%')" ;
260264 public readonly record struct GetAuthorByNamePatternRow ( long Id , string Name , string ? Bio ) ;
261265 public readonly record struct GetAuthorByNamePatternArgs ( string ? NamePattern ) ;
262266 public async Task < List < GetAuthorByNamePatternRow > > GetAuthorByNamePattern ( GetAuthorByNamePatternArgs args )
@@ -297,7 +301,8 @@ public async Task<List<GetAuthorByNamePatternRow>> GetAuthorByNamePattern(GetAut
297301 }
298302 }
299303
300- private const string DeleteAuthorSql = "DELETE FROM authors WHERE name = @name" ;
304+ private const string DeleteAuthorSql = @"DELETE FROM authors
305+ WHERE name = @name" ;
301306 public readonly record struct DeleteAuthorArgs ( string Name ) ;
302307 public async Task DeleteAuthor ( DeleteAuthorArgs args )
303308 {
@@ -354,7 +359,9 @@ public async Task DeleteAllAuthors()
354359 }
355360 }
356361
357- private const string UpdateAuthorsSql = "UPDATE authors SET bio = @bio WHERE bio IS NOT NULL" ;
362+ private const string UpdateAuthorsSql = @"UPDATE authors
363+ SET bio = @bio
364+ WHERE bio IS NOT NULL" ;
358365 public readonly record struct UpdateAuthorsArgs ( string ? Bio ) ;
359366 public async Task < long > UpdateAuthors ( UpdateAuthorsArgs args )
360367 {
@@ -509,7 +516,9 @@ public async Task<long> CreateBook(CreateBookArgs args)
509516 }
510517 }
511518
512- private const string ListAllAuthorsBooksSql = "SELECT authors.id, authors.name, authors.bio, books.id, books.name, books.author_id, books.description FROM authors JOIN books ON authors.id = books.author_id ORDER BY authors.name" ;
519+ private const string ListAllAuthorsBooksSql = @"SELECT authors.id, authors.name, authors.bio, books.id, books.name, books.author_id, books.description
520+ FROM authors JOIN books ON authors.id = books.author_id
521+ ORDER BY authors.name" ;
513522 public readonly record struct ListAllAuthorsBooksRow ( Author ? Author , Book ? Book ) ;
514523 public async Task < List < ListAllAuthorsBooksRow > > ListAllAuthorsBooks ( )
515524 {
@@ -547,7 +556,9 @@ public async Task<List<ListAllAuthorsBooksRow>> ListAllAuthorsBooks()
547556 }
548557 }
549558
550- private const string GetDuplicateAuthorsSql = "SELECT authors1.id, authors1.name, authors1.bio, authors2.id, authors2.name, authors2.bio FROM authors authors1 JOIN authors authors2 ON authors1.name = authors2.name WHERE authors1.id < authors2.id" ;
559+ private const string GetDuplicateAuthorsSql = @"SELECT authors1.id, authors1.name, authors1.bio, authors2.id, authors2.name, authors2.bio
560+ FROM authors authors1 JOIN authors authors2 ON authors1.name = authors2.name
561+ WHERE authors1.id < authors2.id" ;
551562 public readonly record struct GetDuplicateAuthorsRow ( Author ? Author , Author ? Author2 ) ;
552563 public async Task < List < GetDuplicateAuthorsRow > > GetDuplicateAuthors ( )
553564 {
@@ -585,7 +596,9 @@ public async Task<List<GetDuplicateAuthorsRow>> GetDuplicateAuthors()
585596 }
586597 }
587598
588- private const string GetAuthorsByBookNameSql = "SELECT authors.id, authors.name, authors.bio, books.id, books.name, books.author_id, books.description FROM authors JOIN books ON authors.id = books.author_id WHERE books.name = @name" ;
599+ private const string GetAuthorsByBookNameSql = @"SELECT authors.id, authors.name, authors.bio, books.id, books.name, books.author_id, books.description
600+ FROM authors JOIN books ON authors.id = books.author_id
601+ WHERE books.name = @name" ;
589602 public readonly record struct GetAuthorsByBookNameRow ( long Id , string Name , string ? Bio , Book ? Book ) ;
590603 public readonly record struct GetAuthorsByBookNameArgs ( string Name ) ;
591604 public async Task < List < GetAuthorsByBookNameRow > > GetAuthorsByBookName ( GetAuthorsByBookNameArgs args )
0 commit comments