···77import gleam/dynamic/decode
88import pog
991010+/// A row you get from running the `count_active_brigades` query
1111+/// defined in `./src/app/sql/count_active_brigades.sql`.
1212+///
1313+/// > 🐿️ This type definition was generated automatically using v4.4.1 of the
1414+/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
1515+///
1616+pub type CountActiveBrigadesRow {
1717+ CountActiveBrigadesRow(count: Int)
1818+}
1919+2020+/// Runs the `count_active_brigades` query
2121+/// defined in `./src/app/sql/count_active_brigades.sql`.
2222+///
2323+/// > 🐿️ This function was generated automatically using v4.4.1 of
2424+/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
2525+///
2626+pub fn count_active_brigades(
2727+ db: pog.Connection,
2828+) -> Result(pog.Returned(CountActiveBrigadesRow), pog.QueryError) {
2929+ let decoder = {
3030+ use count <- decode.field(0, decode.int)
3131+ decode.success(CountActiveBrigadesRow(count:))
3232+ }
3333+3434+ "SELECT COUNT(id)
3535+FROM brigade
3636+WHERE is_active = TRUE;
3737+"
3838+ |> pog.query
3939+ |> pog.returning(decoder)
4040+ |> pog.execute(db)
4141+}
4242+1043/// Runs the `register_new_user` query
1144/// defined in `./src/app/sql/register_new_user.sql`.
1245///