wip: currently rewriting the project as a full stack application tangled.org/kacaii.dev/sigo
gleam

:art: lint and format code

+45 -22
+8 -6
src/app/domain/brigade/sql.gleam
··· 41 41 " 42 42 |> pog.query 43 43 |> pog.parameter(pog.text(uuid.to_string(arg_1))) 44 - |> pog.parameter( 45 - pog.array(fn(value) { pog.text(uuid.to_string(value)) }, arg_2), 46 - ) 44 + |> pog.parameter(pog.array( 45 + fn(value) { pog.text(uuid.to_string(value)) }, 46 + arg_2, 47 + )) 47 48 |> pog.returning(decoder) 48 49 |> pog.execute(db) 49 50 } ··· 353 354 " 354 355 |> pog.query 355 356 |> pog.parameter(pog.text(uuid.to_string(arg_1))) 356 - |> pog.parameter( 357 - pog.array(fn(value) { pog.text(uuid.to_string(value)) }, arg_2), 358 - ) 357 + |> pog.parameter(pog.array( 358 + fn(value) { pog.text(uuid.to_string(value)) }, 359 + arg_2, 360 + )) 359 361 |> pog.returning(decoder) 360 362 |> pog.execute(db) 361 363 }
+12 -4
src/app/domain/data_analysis/sql.gleam
··· 131 131 "medic_emergency" -> decode.success(MedicEmergency) 132 132 _ -> decode.failure(Other, "OccurrenceCategoryEnum") 133 133 } 134 - }/// Corresponds to the Postgres `occurrence_priority_enum` enum. 134 + } 135 + 136 + /// Corresponds to the Postgres `occurrence_priority_enum` enum. 135 137 /// 136 138 /// > 🐿️ This type definition was generated automatically using v4.6.0 of the 137 139 /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). ··· 150 152 "low" -> decode.success(Low) 151 153 _ -> decode.failure(High, "OccurrencePriorityEnum") 152 154 } 153 - }/// Corresponds to the Postgres `occurrence_subcategory_enum` enum. 155 + } 156 + 157 + /// Corresponds to the Postgres `occurrence_subcategory_enum` enum. 154 158 /// 155 159 /// > 🐿️ This type definition was generated automatically using v4.6.0 of the 156 160 /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). ··· 174 178 HeartStop 175 179 } 176 180 177 - fn occurrence_subcategory_enum_decoder() -> decode.Decoder(OccurrenceSubcategoryEnum) { 181 + fn occurrence_subcategory_enum_decoder() -> decode.Decoder( 182 + OccurrenceSubcategoryEnum, 183 + ) { 178 184 use occurrence_subcategory_enum <- decode.then(decode.string) 179 185 case occurrence_subcategory_enum { 180 186 "injured_animal" -> decode.success(InjuredAnimal) ··· 195 201 "heart_stop" -> decode.success(HeartStop) 196 202 _ -> decode.failure(InjuredAnimal, "OccurrenceSubcategoryEnum") 197 203 } 198 - }/// Corresponds to the Postgres `user_role_enum` enum. 204 + } 205 + 206 + /// Corresponds to the Postgres `user_role_enum` enum. 199 207 /// 200 208 /// > 🐿️ This type definition was generated automatically using v4.6.0 of the 201 209 /// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
+18 -12
src/app/domain/occurrence/sql.gleam
··· 41 41 " 42 42 |> pog.query 43 43 |> pog.parameter(pog.text(uuid.to_string(arg_1))) 44 - |> pog.parameter( 45 - pog.array(fn(value) { pog.text(uuid.to_string(value)) }, arg_2), 46 - ) 44 + |> pog.parameter(pog.array( 45 + fn(value) { pog.text(uuid.to_string(value)) }, 46 + arg_2, 47 + )) 47 48 |> pog.returning(decoder) 48 49 |> pog.execute(db) 49 50 } ··· 511 512 " 512 513 |> pog.query 513 514 |> pog.parameter(pog.text(uuid.to_string(arg_1))) 514 - |> pog.parameter( 515 - pog.array(fn(value) { pog.text(uuid.to_string(value)) }, arg_2), 516 - ) 515 + |> pog.parameter(pog.array( 516 + fn(value) { pog.text(uuid.to_string(value)) }, 517 + arg_2, 518 + )) 517 519 |> pog.returning(decoder) 518 520 |> pog.execute(db) 519 521 } ··· 551 553 MedicEmergency -> "medic_emergency" 552 554 } 553 555 |> pog.text 554 - }/// Corresponds to the Postgres `occurrence_priority_enum` enum. 556 + } 557 + 558 + /// Corresponds to the Postgres `occurrence_priority_enum` enum. 555 559 /// 556 560 /// > 🐿️ This type definition was generated automatically using v4.6.0 of the 557 561 /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). ··· 579 583 Low -> "low" 580 584 } 581 585 |> pog.text 582 - }/// Corresponds to the Postgres `occurrence_subcategory_enum` enum. 586 + } 587 + 588 + /// Corresponds to the Postgres `occurrence_subcategory_enum` enum. 583 589 /// 584 590 /// > 🐿️ This type definition was generated automatically using v4.6.0 of the 585 591 /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). ··· 603 609 HeartStop 604 610 } 605 611 606 - fn occurrence_subcategory_enum_decoder() -> decode.Decoder(OccurrenceSubcategoryEnum) { 612 + fn occurrence_subcategory_enum_decoder() -> decode.Decoder( 613 + OccurrenceSubcategoryEnum, 614 + ) { 607 615 use occurrence_subcategory_enum <- decode.then(decode.string) 608 616 case occurrence_subcategory_enum { 609 617 "injured_animal" -> decode.success(InjuredAnimal) ··· 626 634 } 627 635 } 628 636 629 - fn occurrence_subcategory_enum_encoder( 630 - occurrence_subcategory_enum, 631 - ) -> pog.Value { 637 + fn occurrence_subcategory_enum_encoder(occurrence_subcategory_enum) -> pog.Value { 632 638 case occurrence_subcategory_enum { 633 639 InjuredAnimal -> "injured_animal" 634 640 Flood -> "flood"
+7
taskfiles/GleamTasks.yml
··· 9 9 desc:  Generate sql queries using Squirrel 10 10 aliases: [s] 11 11 cmd: gleam run -m squirrel 12 + 13 + lint: 14 + desc:  Lint and Format code 15 + cmds: 16 + - gleam check 17 + - gleam format 18 + - gleam format --check src test