Click or drag to resize

SphinxQLConnection Class

Represents a connection to Sphinx. This class cannot be inherited.
Inheritance Hierarchy
SystemObject
  SystemMarshalByRefObject
    System.ComponentModelComponent
      System.Data.CommonDbConnection
        SphinxConnector.SphinxQLSphinxQLConnection

Namespace: SphinxConnector.SphinxQL
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.0.0
Syntax
public sealed class SphinxQLConnection : DbConnection

The SphinxQLConnection type exposes the following members.

Constructors
 NameDescription
Public methodSphinxQLConnection Initializes a new instance of the SphinxQLConnection class.
Public methodSphinxQLConnection(String) Initializes a new instance of the SphinxQLConnection class.
Top
Properties
 NameDescription
Public propertyConnectionString Gets or sets the string used to open the connection.
(Overrides DbConnectionConnectionString)
Public propertyConnectionTimeout Gets the time (in seconds) to wait while establishing a connection before terminating the attempt and generating an error.
(Overrides DbConnectionConnectionTimeout)
Public propertyContainerGets the IContainer that contains the Component.
(Inherited from Component)
Public propertyDatabase Always returns "Sphinx".
(Overrides DbConnectionDatabase)
Public propertyDataSource Gets the name of the Sphinx server to which to connect.
(Overrides DbConnectionDataSource)
Public propertyServerVersion Gets a string that represents the version of the server to which the object is connected.
(Overrides DbConnectionServerVersion)
Public propertySiteGets or sets the ISite of the Component.
(Inherited from Component)
Public propertyState Gets a string that describes the state of the connection.
(Overrides DbConnectionState)
Top
Methods
 NameDescription
Public methodBeginTransaction Begins a new transaction.
Public methodBeginTransaction(IsolationLevel) Begins a new transaction with the specified isolation level. Not supported.
Public methodBeginTransactionAsync Begins a new transaction asynchronously.
Public methodBeginTransactionAsync(CancellationToken) Begins a new transaction asynchronously.
Public methodChangeDatabase Changes the current database for an open connection. Not supported.
(Overrides DbConnectionChangeDatabase(String))
Public methodClose Closes the connection to searchd. This is the preferred method of closing any open connection.
(Overrides DbConnectionClose)
Public methodCloseAsync Asynchronously closes the connection to searchd. This is the preferred method of closing any open connection.
Public methodCreateCommand Creates and returns a SphinxQLCommand object associated with the current connection.
Public methodCreateCommand(String) Creates and returns a SphinxQLCommand object associated with the current connection and the provided command text.
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject)
Public methodDisposeReleases all resources used by the Component.
(Inherited from Component)
Public methodDisposeAsync Asynchronously diposes the connection object.
Public methodEnlistTransaction Enlists in the specified transaction.
(Overrides DbConnectionEnlistTransaction(Transaction))
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject)
Public methodGetSchema Returns schema information for the data source of this SphinxQLConnection. Not supported.
(Overrides DbConnectionGetSchema)
Public methodGetSchema(String) Returns schema information for the data source of this SphinxQLConnection using the specified string for the schema name. Not supported.
(Overrides DbConnectionGetSchema(String))
Public methodGetSchema(String, String) Returns schema information for the data source of this SphinxQLConnection using the specified string for the schema name and the specified string array for the restriction values. Not supported.
(Overrides DbConnectionGetSchema(String, String))
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject)
Public methodOpen Opens a connection to Sphinx.
(Overrides DbConnectionOpen)
Public methodOpenAsyncAn asynchronous version of Open, which opens a database connection with the settings specified by the ConnectionString. This method invokes the virtual method OpenAsync(CancellationToken) with CancellationToken.None.
(Inherited from DbConnection)
Public methodOpenAsync(CancellationToken) Opens a connection to Sphinx.
(Overrides DbConnectionOpenAsync(CancellationToken))
Public methodToStringReturns a String containing the name of the Component, if any. This method should not be overridden.
(Inherited from Component)
Top
Events
 NameDescription
Public eventDisposedOccurs when the component is disposed by a call to the Dispose method.
(Inherited from Component)
Public eventStateChangeOccurs when the state of the event changes.
(Inherited from DbConnection)
Top
Explicit Interface Implementations
 NameDescription
Explicit interface implementationPrivate methodIDbConnectionBeginTransactionBegins a database transaction.
(Inherited from DbConnection)
Explicit interface implementationPrivate methodIDbConnectionBeginTransaction(IsolationLevel)Begins a database transaction with the specified IsolationLevel value.
(Inherited from DbConnection)
Explicit interface implementationPrivate methodIDbConnectionCreateCommandCreates and returns a DbCommand object that is associated with the current connection.
(Inherited from DbConnection)
Top
Remarks
On creation, all properties of the class are set to their initial values. The default ConnectionString is an empty string which is equivalent to "Data Source=localhost;Port=9306;pooling=false;Min Pool Size=5;Max Pool Size=20".
Example
The following example creates a SphinxQLCommand and a SphinxQLConnection to retrieve data from an index. string connectionString = "Data Source=localhost;Port=9306;pooling=true"; using (SphinxQLConnection connection = new SphinxQLConnection(connectionString)) { SphinxQLCommand sphinxQLCommand = new SphinxQLCommand("SELECT * from sakila;", sphinxQLConnection); connection.Open(); using (SphinxQLDataReader sphinxQLDataReader = sphinxQLCommand.ExecuteReader()) { while(sphinxQLDataReader.Read()) { Console.Writeline(sphinxQLDataReader.GetInt32("id"); } } }
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also