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