Table of Contents

Class PolarToolsComponent_InstantSQL

Namespace
PolarStudio
Assembly
PolarStudio.dll

This class is the implementation of the Polar Tools component 'Instant SQL'.

public class PolarToolsComponent_InstantSQL : PolarToolsComponent
Inheritance
PolarToolsComponent_InstantSQL
Inherited Members
Extension Methods

Fields

AllowAllActions

This property gets/sets if all actions (like update, delete, create table) are allowed or only plain select queries.

public bool AllowAllActions

Field Value

bool

AllowOtherDatabases

This property gets/sets if access to other databases is allowed or not. Please note that preventing access to other databases is done based on analysing the query text and may not be 100% tamper proof.

public bool AllowOtherDatabases

Field Value

bool

ExportTextAsUTF8

This property gets/sets if text exports are to be encoded using UTF8.

public bool ExportTextAsUTF8

Field Value

bool

SavedQueries

Returns the list of saved queries.

public List<SavedQuery> SavedQueries

Field Value

List<SavedQuery>

Properties

ActiveQueryIndex

This property gets/sets the index (int) of the current active query.

public int ActiveQueryIndex { get; set; }

Property Value

int

Caption

This property gets/sets the caption for this component as shown in the tabs in Polar Tools.

public override string Caption { get; set; }

Property Value

string

MaxRecordsToAffect

This property gets/sets the max number of records to affect in an update or delete query. If this limit is exceeded, the transaction is rolled back.

public int MaxRecordsToAffect { get; set; }

Property Value

int

MaxRecordsToAffectWithoutConfirmation

This property gets/sets the max number of records to affect in an update query without confirmation. If this limit is exceeded, the user must confirm the update or delete.

public int MaxRecordsToAffectWithoutConfirmation { get; set; }

Property Value

int

Name

Returns the name of this component.

public override string Name { get; }

Property Value

string

Methods

AddQuery(string)

This method adds the given pQueryText to the list of saved queries and activates that 'slot'. If this query is already present, that slot is automatically activated. If an empty slot is found, this empty slot is used. Else, the query is added at the end.

public bool AddQuery(string pQueryText)

Parameters

pQueryText string

The query text to add.

Returns

bool

True if a not empty query text was given, False if the query text was empty.

DeleteQuery(int)

This method removes the query at the given index. Please note that if the last saved query is deleted, a new empty query is automatically added at position 1.

public bool DeleteQuery(int pIndex)

Parameters

pIndex int

The 1-based index of the query to remove.

Returns

bool

True if the given index is valid, False if the index is invalid.

GetQuery(int)

This method returns the query text at the given index.

public string GetQuery(int pIndex)

Parameters

pIndex int

The 1-based index of the query to retrieve.

Returns

string

The query of the given index or an empty string if the index is out of bounds.

QueryCount()

Returns the number of saved queries.

public int QueryCount()

Returns

int

The number of saved queries.

SetQuery(int, string)

This method updates the query of one specific saved query.

public bool SetQuery(int pIndex, string pQueryText)

Parameters

pIndex int

The 1-based index of the query to retrieve.

pQueryText string

The new query text.

Returns

bool

True if the given index is valid, False if the index is invalid.