1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib
Ryuta Kamizono 1b68ead8f8 Use squiggly heredoc to strip odd indentation in the executed SQL
Before:

```
LOG:  execute <unnamed>:             SELECT t.oid, t.typname
                    FROM pg_type as t
                    WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'bool')

LOG:  execute <unnamed>:               SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
                      FROM pg_type as t
                      LEFT JOIN pg_range as r ON oid = rngtypid
                      WHERE
                        t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'interval', 'path', 'line', 'polygon', 'circle', 'lseg', 'box', 'time', 'timestamp', 'numeric')
                        OR t.typtype IN ('r', 'e', 'd')
                        OR t.typinput::varchar = 'array_in'
                        OR t.typelem != 0

LOG:  statement: SHOW TIME ZONE
LOG:  statement: SELECT 1
LOG:  execute <unnamed>:               SELECT COUNT(*)
                      FROM pg_class c
                      LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
                      WHERE c.relkind IN ('r','v','m') -- (r)elation/table, (v)iew, (m)aterialized view
                      AND c.relname = 'accounts'
                      AND n.nspname = ANY (current_schemas(false))
```

After:

```
LOG:  execute <unnamed>: SELECT t.oid, t.typname
        FROM pg_type as t
        WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'bool')

LOG:  execute <unnamed>: SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
        FROM pg_type as t
        LEFT JOIN pg_range as r ON oid = rngtypid
                      WHERE
                        t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'interval', 'path', 'line', 'polygon', 'circle', 'lseg', 'box', 'time', 'timestamp', 'numeric')
                        OR t.typtype IN ('r', 'e', 'd')
                        OR t.typinput::varchar = 'array_in'
                        OR t.typelem != 0

LOG:  statement: SHOW TIME ZONE
LOG:  statement: SELECT 1
LOG:  execute <unnamed>: SELECT COUNT(*)
        FROM pg_class c
        LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
        WHERE c.relkind IN ('r','v','m') -- (r)elation/table, (v)iew, (m)aterialized view
        AND c.relname = 'accounts'
        AND n.nspname = ANY (current_schemas(false))
```
2018-11-22 19:43:53 +09:00
..
active_record Use squiggly heredoc to strip odd indentation in the executed SQL 2018-11-22 19:43:53 +09:00
arel Arel: Implemented DB-aware NULL-safe comparison () 2018-11-15 14:49:55 -05:00
rails/generators Refactor migrations_path command option to database 2018-09-28 14:24:36 -04:00
active_record.rb Refactors Active Record connection management 2018-08-30 10:06:45 -04:00
arel.rb Extract Arel.arel_node? helper method 2018-09-28 04:57:12 +09:00