- Replace deprecated
gleam/regex
module withgleam/regexp
. (Surya Rose)
- Improved error message when using a Postgres version that's too old. (Giacomo Cavalieri)
-
Fixed a bug where certain queries using conditions on foreign key would generate code with the wrong optional types. (Giacomo Cavalieri)
-
drop
is now highlighted as a keyword in sql snippets in error messages. (Giacomo Cavalieri)
- Fixed a bug where certain queries would generate code with the wrong optional types. (Giacomo Cavalieri)
- The generated code now uses the
pog
package instead ofgleam_pgo
. (Giacomo Cavalieri)
-
Squirrel now errors if a query returns multiple columns with the same name instead of generating invalid Gleam code. For example:
select 1 as duplicate, 2 as duplicate, 3 as not_duplicate
Results in the following error:
Error: Duplicate names ╭─ query.sql │ 1 │ select 2 │ 1 as duplicate, 3 │ 2 as duplicate, 4 │ 3 as not_duplicate ┆ This query returns multiple values sharing the same name: `duplicate`.
-
Added support for
postgresql
URL scheme. (Valentin Iancu) -
Switched to
decode
's newzero
API for generated decoders. (Giacomo Cavalieri) -
Added support for user-defined enums. An enum like this one:
create type squirrel_colour as enum ( 'light_brown', 'grey', 'red' )
Is automatically turned into the equivalent Gleam type:
pub type SquirrelColour { LightBrown Grey Red }
-
Fixed a bug where a query failing to parse would cause code generation for other queries to fail unexpectedly. (Giacomo Cavalieri)
-
Fixed a bug where a query starting with a semicolon would result in a crash instead of a proper syntax error. (Giacomo Cavalieri)
-
Fixed a bug where the generated code would have needless empty lines. (Giacomo Cavalieri)
-
Fixed a bug where an authentication error would result in a failure with a confusing error message. (Giacomo Cavalieri)
-
Added support for the
timestamp
type, represented as tuples#(#(Int, Int, Int), #(Int Int Int))
with#(#(year, month, day), #(hour, minute, second))
. (Tommy Heffernan) -
Fixed a bug where the SQL query displayed in an error would be dimmed out. (Giacomo Cavalieri)
-
Added more SQL keywords to syntax highlighting in error messages. (Giacomo Cavalieri)
-
Fixed a bug where squirrel would not properly display some error messages. (Giacomo Cavalieri)
-
Improved syntax highlighting for sql queries displayed in error messages. (Giacomo Cavalieri)
-
Added a small hint in case no query is found, suggesting the correct project structure to follow. (Giacomo Cavalieri)
- Added support for the
date
type, represented as a triple#(Int, Int, Int)
with#(year, month, day)
. (Giovanni Paone)
- Added support for the
bytea
type, represented as aBitArray
. (Giacomo Cavalieri)
-
Added support for the
uuid
type, represented as aUuid
(from theyouid
package). (Giacomo Cavalieri) -
Fixed a bug where
gleam run -m squirrel
would return a0
exit code even in case of errors. (Giacomo Cavalieri)
- Fixed a bug where the generated code would be missing a
gleam/list
import when dealing with Postgres arrays. (Giacomo Cavalieri)
- Fixed a bug where Squirrel would panic if not able to establish a TCP connection to the postgres server. Now it gracefully handles the error by showing an appropriate error message. (Giacomo Cavalieri)
-
One can now use the
DATABASE_URL
env variable to specify a connection string that Squirrel will use to connect to the Postgres database. All the regular Postgres variables are still supported, but Squirrel will pickDATABASE_URL
over those if it is set. (Giacomo Cavalieri) -
Added support for the
jsonb
type, encoded as aJson
(from thegleam_json
package) and decoded as a GleamString
. (Giacomo Cavalieri) -
Added support for the
json
type, encoded asJson
(from thegleam_json
package) and decoded as a GleamString
. (Giacomo Cavalieri)
-
Squirrel now supports the
SCRAM-SHA-256
authentication. (Giacomo Cavalieri) -
Squirrel now uses the name of your Gleam project as the default database name to connect to. (Giacomo Cavalieri)
-
Fixed a bug where Squirrel couldn't generate code for queries that return no rows like
insert into
. (Giacomo Cavalieri) -
Avoid panicking when the authenticated user doesn't have the permission to access a given table. (Giacomo Cavalieri)
-
Squirrel now supports plaintext password authentication. (Giacomo Cavalieri)
-
Squirrel now uses
"postgres"
as the default user in case thePGUSER
environment variable is not set. (Giacomo Cavalieri) -
Added support for the
varchar
andbpchar
types, mapped to GleamString
s. (Giacomo Cavalieri) -
Improved the error message in case Squirrel cannot connect to the Postgres server with the given database and username. Instead of a not-really-helpful
Cannot receive message: Closed
the error now properly explains what went wrong and hot to solve the issue:Error: Cannot connect I couldn't connect to database `database` with user `postgres`. Hint: You can change the default user and database by setting the `PGUSER` and `PGDATABASE` environment variables.
- Fixed a bug with the code generation of
Option
types. (Giacomo Cavalieri)
- 🎉 First release!