squirrel icon indicating copy to clipboard operation
squirrel copied to clipboard

Fluent SQL generation for golang

Results 94 squirrel issues
Sort by recently updated
recently updated
newest added

https://github.com/Masterminds/squirrel/blob/9b18b54aed2aa831665b8e896cde063d51d921fa/placeholder.go#L97-L103 At line 100. since we already know that `len(sql[p:]) > 1` from the previous if check, we know that `len(sql[p:]) == 1` will always be false. unless I'm missing...

When using subquery in `JoinClause` with dollar placeholders query builder produces wrong placeholder numbers. This test reproduces the problem. ```golang func TestSelectJoinClausePlaceholderNumbering(t *testing.T) { subquery := Select("a").Where(Eq{"b": 2}).PlaceholderFormat(Dollar) sql, args,...

How to use select max(field) from tablename syntax with postgres db store engine in squirrel?

I only see documentation for using '?' as a placeholder. This is a request for more robust placeholder syntax, so the following would work: Desired behavior: ```go keyBytes := req.GetKey().GetKeyBytes()...

Any example where `from` could be used with `update` query. ```postgres update albums set num = jsonb_set(num, '{folders}', to_jsonb(coalesce(sq.counts, 0)), false) from (select s.album_id, COUNT(s.album_id) as counts from file_system s...

As example: ```go myQuery := myQuery.From(fmt.Sprintf(`myTable, to_tsquery('%s') AS q`, myVariable)) ```

Hello, I got databases from Oracle, and I need help on how to correctly compose an Insert query My Code: query := sq.Insert("N_ACCOUNTS"). Columns("ACCOUNT_ID", "ACC", "MODIFIED_DATE", "CREATION_DATE", "LOCKED_FLAG", "NEED_REPLICATION"). Values(account.AccountId,...

This is a fix for https://github.com/Masterminds/squirrel/issues/281