@graphenedata/cli 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +3 -3
- package/README.md +138 -0
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/bin.js +2 -2
- package/dist/cli/bigQuery-I3F46SC6.js +75 -0
- package/dist/cli/bigQuery-I3F46SC6.js.map +7 -0
- package/dist/cli/chunk-OVWODUTJ.js +12849 -0
- package/dist/cli/chunk-OVWODUTJ.js.map +7 -0
- package/dist/cli/chunk-QAXEOZ43.js +53 -0
- package/dist/cli/chunk-QAXEOZ43.js.map +7 -0
- package/dist/cli/cli.js +245 -10290
- package/dist/cli/clickhouse-ZN5AN2UL.js +64 -0
- package/dist/cli/clickhouse-ZN5AN2UL.js.map +7 -0
- package/dist/cli/duckdb-IYBIO5KJ.js +87 -0
- package/dist/cli/duckdb-IYBIO5KJ.js.map +7 -0
- package/dist/cli/serve2-TNN5EROW.js +447 -0
- package/dist/cli/serve2-TNN5EROW.js.map +7 -0
- package/dist/cli/snowflake-MOQB5GA4.js +128 -0
- package/dist/cli/snowflake-MOQB5GA4.js.map +7 -0
- package/dist/index.d.ts +63 -0
- package/dist/lang/index.d.ts +63 -0
- package/dist/skills/graphene/SKILL.md +235 -0
- package/dist/skills/graphene/references/big-value.md +20 -0
- package/dist/skills/graphene/references/date-range.md +64 -0
- package/dist/skills/graphene/references/dropdown.md +62 -0
- package/dist/skills/graphene/references/echarts.md +162 -0
- package/dist/skills/graphene/references/gsql.md +393 -0
- package/dist/skills/graphene/references/model-gsql.md +72 -0
- package/dist/skills/graphene/references/table.md +143 -0
- package/dist/skills/graphene/references/text-input.md +29 -0
- package/dist/ui/app.css +263 -299
- package/dist/ui/component-utilities/dataShaping.ts +484 -0
- package/dist/ui/component-utilities/dataSummary.ts +57 -0
- package/dist/ui/component-utilities/enrich.ts +763 -0
- package/dist/ui/component-utilities/format.ts +177 -0
- package/dist/ui/component-utilities/inputUtils.ts +48 -9
- package/dist/ui/component-utilities/theme.ts +200 -0
- package/dist/ui/component-utilities/themeStores.ts +26 -21
- package/dist/ui/component-utilities/types.ts +70 -0
- package/dist/ui/components/AreaChart.svelte +57 -105
- package/dist/ui/components/BarChart.svelte +71 -129
- package/dist/ui/components/BigValue.svelte +24 -40
- package/dist/ui/components/Column.svelte +11 -19
- package/dist/ui/components/DateRange.svelte +71 -34
- package/dist/ui/components/Dropdown.svelte +82 -49
- package/dist/ui/components/DropdownOption.svelte +1 -2
- package/dist/ui/components/ECharts.svelte +179 -60
- package/dist/ui/components/InlineDelta.svelte +51 -32
- package/dist/ui/components/LineChart.svelte +54 -125
- package/dist/ui/components/PieChart.svelte +27 -37
- package/dist/ui/components/QueryLoad.svelte +78 -44
- package/dist/ui/components/Row.svelte +2 -1
- package/dist/ui/components/ScatterPlot.svelte +52 -0
- package/dist/ui/components/Skeleton.svelte +32 -0
- package/dist/ui/components/Table.svelte +3 -2
- package/dist/ui/components/TableGroupRow.svelte +28 -36
- package/dist/ui/components/TableHarness.svelte +32 -0
- package/dist/ui/components/TableHeader.svelte +34 -59
- package/dist/ui/components/TableRow.svelte +15 -39
- package/dist/ui/components/TableSubtotalRow.svelte +26 -21
- package/dist/ui/components/TableTotalRow.svelte +27 -37
- package/dist/ui/components/TextInput.svelte +17 -14
- package/dist/ui/components/Value.svelte +25 -0
- package/dist/ui/components/_Table.svelte +80 -76
- package/dist/ui/internal/ChartGallery.svelte +527 -0
- package/dist/ui/internal/ErrorDisplay.svelte +60 -0
- package/dist/ui/internal/LocalApp.svelte +87 -19
- package/dist/ui/internal/PageNavGroup.svelte +269 -0
- package/dist/ui/internal/Sidebar.svelte +178 -0
- package/dist/ui/internal/SidebarToggle.svelte +47 -0
- package/dist/ui/internal/StyleGallery.svelte +244 -0
- package/dist/ui/internal/clientCache.ts +15 -13
- package/dist/ui/internal/pageInputs.svelte.js +292 -0
- package/dist/ui/internal/queryEngine.ts +124 -132
- package/dist/ui/internal/runSocket.ts +59 -0
- package/dist/ui/internal/sidebar.svelte.js +18 -0
- package/dist/ui/internal/telemetry.ts +52 -17
- package/dist/ui/internal/types.d.ts +7 -0
- package/dist/ui/web.js +55 -13
- package/package.json +40 -41
- package/dist/docs/agent-instructions.md +0 -18
- package/dist/docs/base.md +0 -98
- package/dist/docs/cli.md +0 -22
- package/dist/docs/graphene.md +0 -1462
- package/dist/ui/component-utilities/autoFormatting.js +0 -301
- package/dist/ui/component-utilities/builtInFormats.js +0 -482
- package/dist/ui/component-utilities/chartContext.js +0 -12
- package/dist/ui/component-utilities/chartWindowDebug.js +0 -21
- package/dist/ui/component-utilities/checkInputs.js +0 -95
- package/dist/ui/component-utilities/convert.js +0 -15
- package/dist/ui/component-utilities/dateParsing.js +0 -57
- package/dist/ui/component-utilities/dropdownContext.ts +0 -1
- package/dist/ui/component-utilities/echarts.js +0 -272
- package/dist/ui/component-utilities/echartsThemes.js +0 -453
- package/dist/ui/component-utilities/formatTitle.js +0 -24
- package/dist/ui/component-utilities/formatting.js +0 -250
- package/dist/ui/component-utilities/getColumnExtents.js +0 -79
- package/dist/ui/component-utilities/getColumnSummary.js +0 -67
- package/dist/ui/component-utilities/getCompletedData.js +0 -114
- package/dist/ui/component-utilities/getDistinctCount.js +0 -7
- package/dist/ui/component-utilities/getDistinctValues.js +0 -15
- package/dist/ui/component-utilities/getSeriesConfig.js +0 -237
- package/dist/ui/component-utilities/getSortedData.js +0 -7
- package/dist/ui/component-utilities/getStackPercentages.js +0 -43
- package/dist/ui/component-utilities/getStackedData.js +0 -17
- package/dist/ui/component-utilities/getYAxisIndex.js +0 -15
- package/dist/ui/component-utilities/globalContexts.js +0 -1
- package/dist/ui/component-utilities/helpers/getCompletedData.helpers.js +0 -119
- package/dist/ui/component-utilities/replaceNulls.js +0 -14
- package/dist/ui/component-utilities/tableUtils.ts +0 -120
- package/dist/ui/components/Area.svelte +0 -214
- package/dist/ui/components/Bar.svelte +0 -350
- package/dist/ui/components/Chart.svelte +0 -989
- package/dist/ui/components/ErrorChart.svelte +0 -118
- package/dist/ui/components/Line.svelte +0 -227
- package/dist/ui/internal/NavSidebar.svelte +0 -396
- package/dist/ui/internal/PageError.svelte +0 -23
- package/dist/ui/internal/checkSocket.ts +0 -48
- package/dist/ui/internal/theme.ts +0 -88
- package/dist/ui/public/inter-latin-ext.woff2 +0 -0
- package/dist/ui/public/inter-latin.woff2 +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Modeling GSQL
|
|
2
|
+
|
|
3
|
+
Conventions and patterns for writing production-quality `.gsql` semantic models. For GSQL syntax reference, see `references/gsql.md`.
|
|
4
|
+
|
|
5
|
+
## Quick start: New table workflow
|
|
6
|
+
|
|
7
|
+
1. Generate a `.gsql` file from the base schema: `npx graphene schema {DB.SCHEMA.TABLE} > tables/{snake_case_table_name}.gsql`
|
|
8
|
+
2. Add table and grain descriptions at the top of the file. If given a dbt project, look up the table's definition, lineage, and related metadata so that you have the full picture.
|
|
9
|
+
3. Add join relationships.
|
|
10
|
+
|
|
11
|
+
- If no join documentation is provided, make an educated guess from PK/FK names.
|
|
12
|
+
- Use `npx graphene run <query>` to confirm the join works as expected: keys match, row counts are sane, and there is no fan-out.
|
|
13
|
+
|
|
14
|
+
4. Add dimensions and measures only if a semantic model to migrate from has been provided.
|
|
15
|
+
|
|
16
|
+
- Do not invent dimensions or measures. Only codify known query patterns.
|
|
17
|
+
- Compile-verify: `npx graphene compile "from TABLE select dimension1, dimension2, measure1, measure2"`
|
|
18
|
+
|
|
19
|
+
5. Add descriptions via comments.
|
|
20
|
+
|
|
21
|
+
- Only add a comment when the column name is not self-explanatory. For example, skip `is_debooked_opportunity BOOLEAN -- Whether the opportunity has been debooked`.
|
|
22
|
+
- Use example values for categorical columns: `npx graphene run "from TABLE select distinct col limit 10"`.
|
|
23
|
+
- Add synonyms only if provided. Do not guess them.
|
|
24
|
+
- Descriptions can be inlined or placed as a block comment on the line above.
|
|
25
|
+
|
|
26
|
+
6. Add GSQL metadata annotations where applicable eg. `#ratio`, `#pct`, `#timeGrain=day`, etc.
|
|
27
|
+
|
|
28
|
+
## File structure
|
|
29
|
+
|
|
30
|
+
Every `.gsql` file follows this section order:
|
|
31
|
+
|
|
32
|
+
```sql
|
|
33
|
+
-- One-sentence description of what this table contains.
|
|
34
|
+
-- Each row is one <entity> (<primary_or_unique_key_col(s)>).
|
|
35
|
+
table DATABASE.SCHEMA.TABLE_NAME (
|
|
36
|
+
|
|
37
|
+
/* Sub-section headers as needed, to group up fields if there are many columns */
|
|
38
|
+
|
|
39
|
+
column_name TYPE -- Description/metadata if necessary
|
|
40
|
+
|
|
41
|
+
-- OR, descriptions/metadata for a field/dimension/measure can be on the lines above it
|
|
42
|
+
-- as long as there is NOT an empty line separating
|
|
43
|
+
column_name2 TYPE
|
|
44
|
+
|
|
45
|
+
/* Join relationships */
|
|
46
|
+
|
|
47
|
+
join { one | many } [ database.schema. ]table [ as alias ] on key = table_or_alias_name.key
|
|
48
|
+
|
|
49
|
+
/* Dimensions */
|
|
50
|
+
|
|
51
|
+
dim_name: expression -- Description/metadata if necessary
|
|
52
|
+
|
|
53
|
+
/* Measures */
|
|
54
|
+
|
|
55
|
+
measure_name: aggregate_expression -- Description/metadata if necessary
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
/* Example queries */ -- Only if correct query usage patterns are not obvious
|
|
59
|
+
|
|
60
|
+
-- Description of query
|
|
61
|
+
select ...
|
|
62
|
+
;
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Section headers use `/* Header */` style. Section headers need a full newline following them or GSQL will assume the header is a comment decorator for the object on the line below it.
|
|
66
|
+
|
|
67
|
+
## Compile-verify workflow
|
|
68
|
+
|
|
69
|
+
Always verify after changes. A parse error in any `.gsql` file prevents all tables from loading. If you see "Unknown table" errors everywhere, check for syntax errors in recently modified files.
|
|
70
|
+
|
|
71
|
+
You can syntax check the whole project with `npx graphene check`.
|
|
72
|
+
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Use a Table component to display a richly formatted table of data from a query. Tables are powerful default choice for data display that allow high information density, and are easy to read.
|
|
2
|
+
|
|
3
|
+
Here's an example:
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
<Table data=orders_summary />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Attributes
|
|
10
|
+
|
|
11
|
+
## Table
|
|
12
|
+
|
|
13
|
+
| Attribute | Description | Required | Options | Default |
|
|
14
|
+
|------|-------------|----------|---------|---------|
|
|
15
|
+
| data | GSQL query or table name | true | query name | - |
|
|
16
|
+
| rows | Number of rows to show in the table before paginating results. Use `"rows=all"` to show all rows in the table. | false | number, `all` | `10` |
|
|
17
|
+
| title | Title for the table | false | string | - |
|
|
18
|
+
| headerColor | Background color of the header row | false | Hex color code, css color name | - |
|
|
19
|
+
| headerFontColor | Font color of the header row | false | Hex color code, css color name | - |
|
|
20
|
+
| totalRow | Show a total row at the bottom of the table, defaults to sum of all numeric columns | false | `true`, `false` | `false` |
|
|
21
|
+
| totalRowColor | Background color of the total row | false | Hex color code, css color name | - |
|
|
22
|
+
| totalFontColor | Font color of the total row | false | Hex color code, css color name | - |
|
|
23
|
+
| rowNumbers | Turns on or off row index numbers | false | `true`, `false` | `false` |
|
|
24
|
+
| rowLines | Turns on or off borders at the bottom of each row | false | `true`, `false` | `true` |
|
|
25
|
+
| rowShading | Shades every second row in light grey | false | `true`, `false` | `false` |
|
|
26
|
+
| backgroundColor | Background color of the table | false | Hex color code, css color name | - |
|
|
27
|
+
| sortable | Enable sort for each column - click the column title to sort | false | `true`, `false` | `true` |
|
|
28
|
+
| sort | Column to sort by on initial page load. Sort direction is asc if unspecified. Can only sort by one column using this prop. If you need multi-column sort, use the order by clause in your sql in combination with this prop. | false | 'column name + asc/desc' | - |
|
|
29
|
+
| formatColumnTitles | Enable auto-formatting of column titles. Turn off to show raw SQL column names | false | `true`, `false` | `true` |
|
|
30
|
+
| wrapTitles | Wrap column titles | false | `true`, `false` | `false` |
|
|
31
|
+
| compact | Enable a more compact table view that allows more content vertically and horizontally | false | `true`, `false` | `false` |
|
|
32
|
+
| link | Makes each row of your table a clickable link. Accepts a column or expression containing the link to use for each row in your table | false | column name, stored expression name, GSQL expression | - |
|
|
33
|
+
| showLinkCol | Whether to show the column supplied to the `link` attribute | false | `true`, `false` | `false` |
|
|
34
|
+
| emptyMessage | Text to display when the table has no rows or fails to render | false | string | `"Unable to render table"` |
|
|
35
|
+
|
|
36
|
+
### Semantic colors
|
|
37
|
+
|
|
38
|
+
Any color attribute on `<Table>` or `<Column>` (e.g. `headerColor`, `barColor`, `colorScale`) accepts the semantic names `primary`, `positive`, `negative`, and `warning` in addition to hex codes and CSS color names. They resolve to the current theme's colors so they stay consistent if the theme changes.
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
<Column id=growth contentType=colorscale colorScale=positive />
|
|
42
|
+
<Column id=churn contentType=colorscale colorScale=negative />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Groups
|
|
46
|
+
|
|
47
|
+
| Attribute | Description | Required | Options | Default |
|
|
48
|
+
|------|-------------|----------|---------|---------|
|
|
49
|
+
| groupBy | Column or expression to use to create groups. Note that groups are currently limited to a single group column. | false | column name, stored expression name, GSQL expression | - |
|
|
50
|
+
| groupType | How the groups are shown in the table. Can be accordion (expand/collapse) or section (group column values are merged across rows) | false | `accordion`, `section` | `accordion` |
|
|
51
|
+
| subtotals | Whether to show aggregated totals for the groups | false | `true`, `false` | `false` |
|
|
52
|
+
| groupsOpen | [groupType=accordion] Whether to show the accordions as open on page load | false | `true`, `false` | `true` |
|
|
53
|
+
| accordionRowColor | [groupType=accordion] Background color for the accordion row | false | Hex color code, css color name | - |
|
|
54
|
+
| subtotalRowColor | [groupType=section] Background color for the subtotal row | false | Hex color code, css color name | - |
|
|
55
|
+
| subtotalFontColor | [groupType=section] Font color for the subtotal row | false | Hex color code, css color name | - |
|
|
56
|
+
| groupNamePosition | [groupType=section] Where the group label will appear in its cell | false | `top`, `middle`, `bottom` | `middle` |
|
|
57
|
+
|
|
58
|
+
# Column sub-component
|
|
59
|
+
|
|
60
|
+
Use the Column sub-component to choose specific columns to display in your table, and to apply options to specific columns. If you don't supply any columns to the table, it will display all columns from your query result.
|
|
61
|
+
|
|
62
|
+
Here's an example:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
<Table data=country_summary>
|
|
66
|
+
<Column id=country />
|
|
67
|
+
<Column id=category />
|
|
68
|
+
<Column id=value_usd />
|
|
69
|
+
<Column id=yoy title="Y/Y Growth" />
|
|
70
|
+
</Table>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
| Attribute | Description | Required | Options | Default |
|
|
74
|
+
|------|-------------|----------|---------|---------|
|
|
75
|
+
| id | Column id (from SQL query) | true | column name | - |
|
|
76
|
+
| title | Override title of column | false | string | column name (formatted) |
|
|
77
|
+
| description | Adds an info icon with description tooltip on hover | false | string | - |
|
|
78
|
+
| align | Align column text | false | `left`, `center`, `right` | `left` |
|
|
79
|
+
| totalAgg | Specify an aggregation function to use for the total row. Accepts predefined functions, custom strings or values | false | `sum`, `mean`, `median`, `min`, `max`, `count`, `countDistinct`, custom string or value | `sum` |
|
|
80
|
+
| wrap | Wrap column text | false | `true`, `false` | `false` |
|
|
81
|
+
| wrapTitle | Wrap column title | false | `true`, `false` | `false` |
|
|
82
|
+
| contentType | Lets you specify how to treat the content within a column. See below for contentType-specific options. | false | `link`, `image`, `delta`, `colorscale`, `html` | - |
|
|
83
|
+
| colGroup | Group name to display above a group of columns. Columns with the same group name will get a shared header above them | false | string | - |
|
|
84
|
+
| redNegatives | Conditionally sets the font color to red based on whether the selected value is less than 0 | false | `true`, `false` | `false` |
|
|
85
|
+
|
|
86
|
+
Column attributes for specific contentTypes:
|
|
87
|
+
|
|
88
|
+
Images (`contentType=image`)
|
|
89
|
+
|
|
90
|
+
| Attribute | Description | Required | Options | Default |
|
|
91
|
+
|------|-------------|----------|---------|---------|
|
|
92
|
+
| height | Height of image in pixels | false | number | original height of image |
|
|
93
|
+
| width | Width of image in pixels | false | number | original width of image |
|
|
94
|
+
| alt | Alt text for image | false | column name | Name of the image file (excluding the file extension) |
|
|
95
|
+
|
|
96
|
+
Links (`contentType=link`)
|
|
97
|
+
|
|
98
|
+
| Attribute | Description | Required | Options | Default |
|
|
99
|
+
|------|-------------|----------|---------|---------|
|
|
100
|
+
| linkLabel | Text to display for link | false | column name, string | raw url |
|
|
101
|
+
| openInNewTab | Whether to open link in new tab | false | `true`, `false` | `false` |
|
|
102
|
+
|
|
103
|
+
Deltas (`contentType=delta`)
|
|
104
|
+
|
|
105
|
+
| Attribute | Description | Required | Options | Default |
|
|
106
|
+
|------|-------------|----------|---------|---------|
|
|
107
|
+
| deltaSymbol | Whether to show the up/down delta arrow symbol | false | `true`, `false` | `true` |
|
|
108
|
+
| downIsGood | If present, negative comparison values appear in green, and positive values appear in red. | false | `true`, `false` | `false` |
|
|
109
|
+
| showValue | Whether to show the delta value. Set this to false to show only the delta arrow indicator. | false | `true`, `false` | `true` |
|
|
110
|
+
| neutralMin | Start of the range for 'neutral' values, which appear in grey font with a dash instead of an up/down arrow. By default, neutral is not applied to any values. | false | number | `0` |
|
|
111
|
+
| neutralMax | End of the range for 'neutral' values, which appear in grey font with a dash instead of an up/down arrow. By default, neutral is not applied to any values. | false | number | `0` |
|
|
112
|
+
| chip | Whether to display the delta as a 'chip', with a background color and border. | false | `true`, `false` | `false` |
|
|
113
|
+
|
|
114
|
+
Sparklines (`contentType=sparkline` | `contentType=sparkarea` | `contentType=sparkbar`)
|
|
115
|
+
|
|
116
|
+
| Attribute | Description | Required | Options | Default |
|
|
117
|
+
|------|-------------|----------|---------|---------|
|
|
118
|
+
| sparkX | Column within an array cell to use as the x-axis for the spark viz. Arrays can be created inside a query using the `"array_agg()"` function from DuckDB | false | column from array cell | - |
|
|
119
|
+
| sparkY | Column within an array cell to use as the y-axis for the spark viz. Arrays can be created inside a query using the `"array_agg()"` function from DuckDB | false | column from array cell | - |
|
|
120
|
+
| sparkYScale | Whether to truncate the y-axis | false | `true`, `false` | `false` |
|
|
121
|
+
| sparkHeight | Height of the spark viz. Making the viz taller will increase the height of the full table row | false | number | `18` |
|
|
122
|
+
| sparkWidth | Width of the spark viz | false | number | `90` |
|
|
123
|
+
| sparkColor | Color of the spark viz | false | Hex color code, css color name | - |
|
|
124
|
+
|
|
125
|
+
Bar chart column (`contentType=bar`)
|
|
126
|
+
|
|
127
|
+
| Attribute | Description | Required | Options | Default |
|
|
128
|
+
|------|-------------|----------|---------|---------|
|
|
129
|
+
| barColor | Color of the bars. Affects positive bars only. See `negativeBarColor` to change color of negative bars | false | Hex color code, css color name | - |
|
|
130
|
+
| negativeBarColor | Color of negative bars | false | Hex color code, css color name | - |
|
|
131
|
+
| hideLabels | Whether to hide the data labels on the bars | false | `true`, `false` | `false` |
|
|
132
|
+
| backgroundColor | Background color for bar chart | false | Hex color code, css color name | `transparent` |
|
|
133
|
+
|
|
134
|
+
Conditional formatting (`contentType=colorscale`)
|
|
135
|
+
|
|
136
|
+
| Attribute | Description | Required | Options | Default |
|
|
137
|
+
|------|-------------|----------|---------|---------|
|
|
138
|
+
| colorScale | Color to use for the scale | false | - | `green` |
|
|
139
|
+
| colorMin | Set a minimum for the scale. Any values below that minimum will appear in the lowest color on the scale | false | number | min of column |
|
|
140
|
+
| colorMid | Set a midpoint for the scale | false | number | mid of column |
|
|
141
|
+
| colorMax | Set a maximum for the scale. Any values above that maximum will appear in the highest color on the scale | false | number | max of column |
|
|
142
|
+
| colorBreakpoints | List of numbers to use as breakpoints for each color in your color scale. Should line up with the colors you provide in `colorScale` | false | list of numbers | - |
|
|
143
|
+
| scaleColumn | Column or expression to use to define the color scale range. Values in this column will have their cell color determined by the value in the scaleColumn | false | column name, stored expression name, GSQL expression | - |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Creates a text input that can be used to filter or search.
|
|
2
|
+
|
|
3
|
+
Here's an example:
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
<TextInput
|
|
7
|
+
name=name_of_input
|
|
8
|
+
title=Search
|
|
9
|
+
/>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The user-inputted text would then be referenced in GSQL via `$name_of_input`. For example:
|
|
13
|
+
|
|
14
|
+
```sql
|
|
15
|
+
select *
|
|
16
|
+
from users
|
|
17
|
+
where email ilike concat('%', $name_of_input, '%')
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Text input values also sync into the page URL query string so a reload or shared link preserves the same filter state.
|
|
21
|
+
|
|
22
|
+
# Attributes
|
|
23
|
+
|
|
24
|
+
| Attribute | Description | Required | Options | Default |
|
|
25
|
+
|------|-------------|----------|---------|---------|
|
|
26
|
+
| name | Name of the text input, used to reference the selected value elsewhere as `"$name"` | true | string | - |
|
|
27
|
+
| title | Title displayed above the text input | false | string | - |
|
|
28
|
+
| placeholder | Alternative placeholder text displayed in the text input | false | string | `"Type to search"` |
|
|
29
|
+
| description | Adds an info icon with description tooltip on hover | false | string | - |
|