C# Class Azavea.Open.DAO.SQLite.SQLiteDaLayer

Implements a FastDao layer customized for PostGreSQL (optionally with PostGIS installed).
Inheritance: Azavea.Open.DAO.SQL.SqlDaDdlLayer
Datei anzeigen Open project: azavea/net-dao-sqlite

Public Methods

Method Description
CreateStoreHouse ( ) : void

Creates the store house specified in the connection descriptor. If this data source doesn't use a store house, this method should be a no-op. If this data source DOES use store houses, but support for adding them is not implemented yet, this should throw a NotImplementedException. Store house typically corresponds to "database". For SQLite this creates a blank database file (no tables).

DeleteStoreHouse ( ) : void

Deletes the store house specified in the connection descriptor. If this data source doesn't use a store house, this method should be a no-op. If this data source DOES use store houses, but support for dropping them is not implemented yet, this should throw a NotImplementedException. Store house typically corresponds to "database". If there is no store house with the given name, this should be a no-op. For SQLite, this just deletes the database file.

SQLiteDaLayer ( SQLiteDescriptor connDesc ) : System

Construct the layer. Should typically be called only by the appropriate ConnectionDescriptor.

SequenceExists ( string name ) : bool

Returns whether a sequence with this name exists or not.

StoreHouseMissing ( ) : bool

Returns true if you need to call "CreateStoreHouse" before storing any data. This method is "Missing" not "Exists" because implementations that do not use a store house (I.E. single-file-based data access layers) can return "false" from this method without breaking either a user's app or the spirit of the method. Store house typically corresponds to "database". For SQLite, this merely verifies the file exists, not that you have any particular security permissions or even that it is a valid SQLite database.

StoreRoomMissing ( ClassMapping mapping ) : bool

Returns true if you need to call "CreateStoreRoom" before storing any data. This method is "Missing" not "Exists" because implementations that do not use a store room can return "false" from this method without breaking either a user's app or the spirit of the method. Store room typically corresponds to "table".

Protected Methods

Method Description
GetAutoType ( Type baseType ) : string

Returns the DDL for the type of an automatically incrementing column. Some databases only store autonums in one col type so baseType may be ignored.

GetByteArrayType ( ) : string

Returns the SQL type used to store a byte array in the DB.

GetLongType ( ) : string

Returns the SQL type used to store a long in the DB.

Method Details

CreateStoreHouse() public method

Creates the store house specified in the connection descriptor. If this data source doesn't use a store house, this method should be a no-op. If this data source DOES use store houses, but support for adding them is not implemented yet, this should throw a NotImplementedException. Store house typically corresponds to "database". For SQLite this creates a blank database file (no tables).
public CreateStoreHouse ( ) : void
return void

DeleteStoreHouse() public method

Deletes the store house specified in the connection descriptor. If this data source doesn't use a store house, this method should be a no-op. If this data source DOES use store houses, but support for dropping them is not implemented yet, this should throw a NotImplementedException. Store house typically corresponds to "database". If there is no store house with the given name, this should be a no-op. For SQLite, this just deletes the database file.
public DeleteStoreHouse ( ) : void
return void

GetAutoType() protected method

Returns the DDL for the type of an automatically incrementing column. Some databases only store autonums in one col type so baseType may be ignored.
protected GetAutoType ( Type baseType ) : string
baseType System.Type The data type of the column (nominally).
return string

GetByteArrayType() protected method

Returns the SQL type used to store a byte array in the DB.
protected GetByteArrayType ( ) : string
return string

GetLongType() protected method

Returns the SQL type used to store a long in the DB.
protected GetLongType ( ) : string
return string

SQLiteDaLayer() public method

Construct the layer. Should typically be called only by the appropriate ConnectionDescriptor.
public SQLiteDaLayer ( SQLiteDescriptor connDesc ) : System
connDesc SQLiteDescriptor Connection to the Firebird DB we'll be using.
return System

SequenceExists() public method

Returns whether a sequence with this name exists or not.
public SequenceExists ( string name ) : bool
name string Name of the sequence to check for.
return bool

StoreHouseMissing() public method

Returns true if you need to call "CreateStoreHouse" before storing any data. This method is "Missing" not "Exists" because implementations that do not use a store house (I.E. single-file-based data access layers) can return "false" from this method without breaking either a user's app or the spirit of the method. Store house typically corresponds to "database". For SQLite, this merely verifies the file exists, not that you have any particular security permissions or even that it is a valid SQLite database.
public StoreHouseMissing ( ) : bool
return bool

StoreRoomMissing() public method

Returns true if you need to call "CreateStoreRoom" before storing any data. This method is "Missing" not "Exists" because implementations that do not use a store room can return "false" from this method without breaking either a user's app or the spirit of the method. Store room typically corresponds to "table".
public StoreRoomMissing ( ClassMapping mapping ) : bool
mapping ClassMapping
return bool