File: 120_array_literals.sql

package info (click to toggle)
sqlfmt 0.29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,580 kB
  • sloc: python: 10,007; sql: 5,626; makefile: 39
file content (24 lines) | stat: -rw-r--r-- 906 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
select
    'xero' as billing_platform, [invoice_id, invoice.invoice_number] as billing_platform_references,
    usage_activity_by_stage_monthly['manage']['events'] as monthly_active_users_last_28_days
from hello
;
select
    split_array('foo, bar, baz, qux', ',')[2] as baz, ['foo', 'bar', 'baz', 'qux'] as literal, ['foo', 'bar', 'baz', 'qux'][2] as indexed_literal,
    some_table.some_dict['a key'] as dict_access
from bar
)))))__SQLFMT_OUTPUT__(((((
select
    'xero' as billing_platform,
    [invoice_id, invoice.invoice_number] as billing_platform_references,
    usage_activity_by_stage_monthly['manage'][
        'events'
    ] as monthly_active_users_last_28_days
from hello
;
select
    split_array('foo, bar, baz, qux', ',')[2] as baz,
    ['foo', 'bar', 'baz', 'qux'] as literal,
    ['foo', 'bar', 'baz', 'qux'][2] as indexed_literal,
    some_table.some_dict['a key'] as dict_access
from bar