DbConnection

Overview

Base class for database connections.

Location

  • Reference: Island.fx
  • Namespace: RemObjects.Elements.System
  • Platforms: Android, iOS, iOS Simulator, macOS, tvOS, tvOS Simulator, Ubuntu, UIKit for Mac, watchOS Simulator, watchOS-arm64_32, watchOS-armv7k, WebAssembly, Windows

Implements

 

constructor    (declared in Object)

Default constructor.

 

constructor

 

DbConnection()

 

init()

 

DbConnection()

BeginTransaction  virtual abstract

Start a transaction and return the transaction object.

 

method BeginTransaction(aLevel: IsolationLevel): DbTransaction

 

DbTransaction BeginTransaction(IsolationLevel aLevel)

 

func BeginTransaction(_ aLevel: IsolationLevel) -> DbTransaction

 

DbTransaction BeginTransaction(IsolationLevel aLevel)

Parameters:

  • aLevel:

ConnectionString

Contains the connection string. Specific per database provider.

 

property ConnectionString: String read write;

 

String ConnectionString { get; set; }

 

var ConnectionString: String { get{} set{} }

 

String ConnectionString { __get; __set; }

CreateCommand  virtual abstract

Creates a new command object.

 

method CreateCommand: DbCommand

 

DbCommand CreateCommand()

 

func CreateCommand() -> DbCommand

 

DbCommand CreateCommand()

CreateCommand (DbTransaction, String, array of String, array of Object): DbCommand

Creates a new command object with the given command, transaction and parameters.

 

method CreateCommand(aTrans: DbTransaction; aCommand: String; aArgNames: array of String; aArgValues: array of Object): DbCommand

 

DbCommand CreateCommand(DbTransaction aTrans, String aCommand, String[] aArgNames, Object[] aArgValues)

 

func CreateCommand(_ aTrans: DbTransaction, _ aCommand: String, _ aArgNames: String..., _ aArgValues: Object...) -> DbCommand

 

DbCommand CreateCommand(DbTransaction aTrans, String aCommand, String[] aArgNames, Object[] aArgValues)

Parameters:

  • aTrans:
  • aCommand:
  • aArgNames:
  • aArgValues:

Dispose  virtual abstract

Dispose this object.

 

method Dispose

 

void Dispose()

 

func Dispose()

 

void Dispose()

Equals  virtual    (declared in Object)

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Execute

Executes a command given a query, anonymous class with the parameters, and transaction and returns the number of affected rows.

 

method Execute(aCommand: String; aArgs: Object; aTransaction: DbTransaction): Int32

 

Int32 Execute(String aCommand, Object aArgs, DbTransaction aTransaction)

 

func Execute(_ aCommand: String, _ aArgs: Object, _ aTransaction: DbTransaction) -> Int32

 

Int32 Execute(String aCommand, Object aArgs, DbTransaction aTransaction)

Parameters:

  • aCommand:
  • aArgs:
  • aTransaction:

ExecuteAsync

Executes a command given a query, anonymous class with the parameters, and transaction and returns the number of affected rows asynchronously.

 

method ExecuteAsync(aCommand: String; aArgs: Object; aTransaction: DbTransaction): Task<Int32>

 

Task<Int32> ExecuteAsync(String aCommand, Object aArgs, DbTransaction aTransaction)

 

func ExecuteAsync(_ aCommand: String, _ aArgs: Object, _ aTransaction: DbTransaction) -> Task<Int32>

 

Task<Int32> ExecuteAsync(String aCommand, Object aArgs, DbTransaction aTransaction)

Parameters:

  • aCommand:
  • aArgs:
  • aTransaction:

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

void Finalize()

 

func Finalize()

 

void Finalize()

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

Open  virtual abstract

Open a connection to this database. Throws if it fails to connect.

 

method Open

 

void Open()

 

func Open()

 

void Open()

OpenIfNeeded  protected

Opens a connection to this database, but only if not already connected.

 

method OpenIfNeeded

 

void OpenIfNeeded()

 

func OpenIfNeeded()

 

void OpenIfNeeded()

Query<T>

Executes a command given a query, anonymous class with the parameters, and transaction and binds the values to the class in T. Ignores any fields not present in the class.

 

method Query<T>(aCommand: String; aArgs: Object; aTransaction: DbTransaction): IEnumerable<T>

 

IEnumerable<T> Query<T>(String aCommand, Object aArgs, DbTransaction aTransaction)

 

func Query<T>(_ aCommand: String, _ aArgs: Object, _ aTransaction: DbTransaction) -> IEnumerable<T>

 

IEnumerable<T> Query<T>(String aCommand, Object aArgs, DbTransaction aTransaction)

Parameters:

  • aCommand:
  • aArgs:
  • aTransaction:

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

State

Contains the current state of this database connection.

 

property State: ConnectionState read write;

 

ConnectionState State { get; set; }

 

var State: ConnectionState { get{} set{} }

 

ConnectionState State { __get; __set; }

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

 

ConnectionString

Contains the connection string. Specific per database provider.

 

property ConnectionString: String read write;

 

String ConnectionString { get; set; }

 

var ConnectionString: String { get{} set{} }

 

String ConnectionString { __get; __set; }

State

Contains the current state of this database connection.

 

property State: ConnectionState read write;

 

ConnectionState State { get; set; }

 

var State: ConnectionState { get{} set{} }

 

ConnectionState State { __get; __set; }

 

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

 

constructor    (declared in Object)

Default constructor.

 

constructor

 

DbConnection()

 

init()

 

DbConnection()

BeginTransaction  virtual abstract

Start a transaction and return the transaction object.

 

method BeginTransaction(aLevel: IsolationLevel): DbTransaction

 

DbTransaction BeginTransaction(IsolationLevel aLevel)

 

func BeginTransaction(_ aLevel: IsolationLevel) -> DbTransaction

 

DbTransaction BeginTransaction(IsolationLevel aLevel)

Parameters:

  • aLevel:

CreateCommand  virtual abstract

Creates a new command object.

 

method CreateCommand: DbCommand

 

DbCommand CreateCommand()

 

func CreateCommand() -> DbCommand

 

DbCommand CreateCommand()

CreateCommand (DbTransaction, String, array of String, array of Object): DbCommand

Creates a new command object with the given command, transaction and parameters.

 

method CreateCommand(aTrans: DbTransaction; aCommand: String; aArgNames: array of String; aArgValues: array of Object): DbCommand

 

DbCommand CreateCommand(DbTransaction aTrans, String aCommand, String[] aArgNames, Object[] aArgValues)

 

func CreateCommand(_ aTrans: DbTransaction, _ aCommand: String, _ aArgNames: String..., _ aArgValues: Object...) -> DbCommand

 

DbCommand CreateCommand(DbTransaction aTrans, String aCommand, String[] aArgNames, Object[] aArgValues)

Parameters:

  • aTrans:
  • aCommand:
  • aArgNames:
  • aArgValues:

Dispose  virtual abstract

Dispose this object.

 

method Dispose

 

void Dispose()

 

func Dispose()

 

void Dispose()

Equals  virtual    (declared in Object)

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Execute

Executes a command given a query, anonymous class with the parameters, and transaction and returns the number of affected rows.

 

method Execute(aCommand: String; aArgs: Object; aTransaction: DbTransaction): Int32

 

Int32 Execute(String aCommand, Object aArgs, DbTransaction aTransaction)

 

func Execute(_ aCommand: String, _ aArgs: Object, _ aTransaction: DbTransaction) -> Int32

 

Int32 Execute(String aCommand, Object aArgs, DbTransaction aTransaction)

Parameters:

  • aCommand:
  • aArgs:
  • aTransaction:

ExecuteAsync

Executes a command given a query, anonymous class with the parameters, and transaction and returns the number of affected rows asynchronously.

 

method ExecuteAsync(aCommand: String; aArgs: Object; aTransaction: DbTransaction): Task<Int32>

 

Task<Int32> ExecuteAsync(String aCommand, Object aArgs, DbTransaction aTransaction)

 

func ExecuteAsync(_ aCommand: String, _ aArgs: Object, _ aTransaction: DbTransaction) -> Task<Int32>

 

Task<Int32> ExecuteAsync(String aCommand, Object aArgs, DbTransaction aTransaction)

Parameters:

  • aCommand:
  • aArgs:
  • aTransaction:

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

void Finalize()

 

func Finalize()

 

void Finalize()

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

Open  virtual abstract

Open a connection to this database. Throws if it fails to connect.

 

method Open

 

void Open()

 

func Open()

 

void Open()

OpenIfNeeded  protected

Opens a connection to this database, but only if not already connected.

 

method OpenIfNeeded

 

void OpenIfNeeded()

 

func OpenIfNeeded()

 

void OpenIfNeeded()

Query<T>

Executes a command given a query, anonymous class with the parameters, and transaction and binds the values to the class in T. Ignores any fields not present in the class.

 

method Query<T>(aCommand: String; aArgs: Object; aTransaction: DbTransaction): IEnumerable<T>

 

IEnumerable<T> Query<T>(String aCommand, Object aArgs, DbTransaction aTransaction)

 

func Query<T>(_ aCommand: String, _ aArgs: Object, _ aTransaction: DbTransaction) -> IEnumerable<T>

 

IEnumerable<T> Query<T>(String aCommand, Object aArgs, DbTransaction aTransaction)

Parameters:

  • aCommand:
  • aArgs:
  • aTransaction:

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()