Skip to main content
Close announcements banner

Writing your own query parser

If you want to use extended parsing outside of the scope of the standard query parser built into QvxLibrary.dll, you can write your own parser. Do this by overriding the method ExtractQuery in your class deriving from QvxConnection (see the code example below). The only requirement for this method is that it returns a QvxDataTable containing a table name and the name of all selected fields. The QvxDataTable type is documented in the QVX SDK API documentation.

/// <summary>

/// Override this method if you want to implement custom parsing of

/// your query. If your query is not an SQL query you need to

/// parse it yourself.

/// </summary>

/// <param name="query">Contains the query/statement to be parsed.</param>

/// <param name="tables">Contains all table definitions defined as

/// MTables in the Init() method.</param>

/// <returns>A QvxDataTable containing a table and its selected fields.</returns>

public virtual QvxDataTable ExtractQuery(string query, List<QvxTable> tables)

{

// TODO: Check if expression has the right syntax

// TODO: Extract table name

// TODO: Extract all selected field names

// TODO: Handle Where statement if present

 

return QvxDataTable;

}

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!