Record Class QueryBrowserSnapshot
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.designer.querybrowser.ai.QueryBrowserSnapshot
- Record Components:
query- the current text in the SQL editor; may be empty.caretPosition- caret offset intoqueryat submit time.selectedText- highlighted substring, or an empty string when nothing is selected.datasourceName- the selected datasource name, or an empty string when no datasource is selected and the project has no default.vendor- the vendor of the selected datasource, ornullwhen no datasource is selected, the vendor lookup hasn't completed, or the datasource is not recognized.queryType- the declared query type (AutoDetect, Select, Update).datasources- all the datasources that are currently available to the user from the Gateway.rowLimit- the row-limit value at submit time when the limit checkbox is on, or0when the checkbox is off or the query type is not Select. Informational only — the runtime applies the limit; the agent uses this to caveat its suggestions.
public record QueryBrowserSnapshot(String query, int caretPosition, String selectedText, String datasourceName, @Nullable DatabaseVendor vendor, SQLQueryType queryType, List<String> datasources, int rowLimit)
extends Record
Frozen view of the Query Browser editor at the moment the user submits an AI prompt. The composer
reads these fields directly into the wire format described in
QueryBrowserAgent; keeping
the snapshot type narrow makes the composer/agent contract easier to reason about than passing
the live panel around.-
Constructor Summary
ConstructorsConstructorDescriptionQueryBrowserSnapshot(String query, int caretPosition, String selectedText, String datasourceName, @Nullable DatabaseVendor vendor, SQLQueryType queryType, List<String> datasources, int rowLimit) Creates an instance of aQueryBrowserSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecaretPositionrecord component.Returns the value of thedatasourceNamerecord component.Returns the value of thedatasourcesrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanfinal inthashCode()Returns a hash code value for this object.query()Returns the value of thequeryrecord component.Returns the value of thequeryTyperecord component.introwLimit()Returns the value of therowLimitrecord component.Returns the value of theselectedTextrecord component.final StringtoString()Returns a string representation of this record class.@Nullable DatabaseVendorvendor()Returns the value of thevendorrecord component.
-
Constructor Details
-
QueryBrowserSnapshot
public QueryBrowserSnapshot(String query, int caretPosition, String selectedText, String datasourceName, @Nullable DatabaseVendor vendor, SQLQueryType queryType, List<String> datasources, int rowLimit) Creates an instance of aQueryBrowserSnapshotrecord class.- Parameters:
query- the value for thequeryrecord componentcaretPosition- the value for thecaretPositionrecord componentselectedText- the value for theselectedTextrecord componentdatasourceName- the value for thedatasourceNamerecord componentvendor- the value for thevendorrecord componentqueryType- the value for thequeryTyperecord componentdatasources- the value for thedatasourcesrecord componentrowLimit- the value for therowLimitrecord component
-
-
Method Details
-
hasDatasource
public boolean hasDatasource()- Returns:
- true when a concrete datasource is selected (either explicitly or via the project default). When false the agent has no connection to ground its schema lookups against and should ask the user to pick one.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
query
-
caretPosition
public int caretPosition()Returns the value of thecaretPositionrecord component.- Returns:
- the value of the
caretPositionrecord component
-
selectedText
Returns the value of theselectedTextrecord component.- Returns:
- the value of the
selectedTextrecord component
-
datasourceName
Returns the value of thedatasourceNamerecord component.- Returns:
- the value of the
datasourceNamerecord component
-
vendor
-
queryType
-
datasources
Returns the value of thedatasourcesrecord component.- Returns:
- the value of the
datasourcesrecord component
-
rowLimit
-