public sealed class SpannerDataAdapter : DbDataAdapter, IComponent, IDisposable, ICloneable, IDbDataAdapter, IDataAdapter
Represents a set of data commands and a database connection that are used to fill the DataSet and update a Spanner database.
Inheritance
Object > MarshalByRefObject > Component > DataAdapter > DbDataAdapter > SpannerDataAdapterNamespace
Google.Cloud.Spanner.DataAssembly
Google.Cloud.Spanner.Data.dll
Constructors
SpannerDataAdapter()
public SpannerDataAdapter()
Initializes a new instance of the SpannerDataAdapter class
SpannerDataAdapter(SpannerConnection, String, String[])
public SpannerDataAdapter(SpannerConnection connection, string autoGeneratedCommandTable, params string[] primaryKeys)
Initializes a new instance of the SpannerDataAdapter class with the specified
Parameters | |
---|---|
Name | Description |
connection | SpannerConnection A connection to the Spanner database. Must not be null. |
autoGeneratedCommandTable | String The Spanner database table to use for automatically generated commands. May be null. |
primaryKeys | String[] The set of columns that form the primary key for
|
Properties
AutoGeneratedCommandPrimaryKeys
public ISet<string> AutoGeneratedCommandPrimaryKeys { get; }
The set of primary keys defined for AutoGeneratedCommandTable.
Property Value | |
---|---|
Type | Description |
ISet<String> |
AutoGeneratedCommandTable
public string AutoGeneratedCommandTable { get; set; }
The table to use for automatically built commands. If set, the SpannerDataAdapter will automatically create commands for SelectCommand, InsertCommand, UpdateCommand and DeleteCommand selecting all columns for that Table. You can choose to customize some or all of the commands and use the autogenerated commands for ones you do not modify. For example, you can set SelectCommand to be a custom SQL Query, and leave the other commands to be based on AutoGeneratedCommandTable
Property Value | |
---|---|
Type | Description |
String |
DeleteCommand
public SpannerCommand DeleteCommand { get; set; }
The SpannerCommand used to delete rows.
Property Value | |
---|---|
Type | Description |
SpannerCommand |
InsertCommand
public SpannerCommand InsertCommand { get; set; }
The SpannerCommand used to insert rows.
Property Value | |
---|---|
Type | Description |
SpannerCommand |
SelectCommand
public SpannerCommand SelectCommand { get; set; }
The SpannerCommand used to run a SQL Query.
Property Value | |
---|---|
Type | Description |
SpannerCommand |
SpannerConnection
public SpannerConnection SpannerConnection { get; set; }
The connection to the Spanner database.
Property Value | |
---|---|
Type | Description |
SpannerConnection |
UpdateCommand
public SpannerCommand UpdateCommand { get; set; }
The SpannerCommand used to update rows.
Property Value | |
---|---|
Type | Description |
SpannerCommand |
Methods
CreateRowUpdatedEvent(DataRow, IDbCommand, StatementType, DataTableMapping)
protected override RowUpdatedEventArgs CreateRowUpdatedEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
Parameters | |
---|---|
Name | Description |
dataRow | DataRow |
command | IDbCommand |
statementType | StatementType |
tableMapping | DataTableMapping |
Returns | |
---|---|
Type | Description |
RowUpdatedEventArgs |
CreateRowUpdatingEvent(DataRow, IDbCommand, StatementType, DataTableMapping)
protected override RowUpdatingEventArgs CreateRowUpdatingEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
Parameters | |
---|---|
Name | Description |
dataRow | DataRow |
command | IDbCommand |
statementType | StatementType |
tableMapping | DataTableMapping |
Returns | |
---|---|
Type | Description |
RowUpdatingEventArgs |
Fill(DataSet, Int32, Int32, String, IDbCommand, CommandBehavior)
protected override int Fill(DataSet dataSet, int startRecord, int maxRecords, string srcTable, IDbCommand command, CommandBehavior behavior)
Parameters | |
---|---|
Name | Description |
dataSet | DataSet |
startRecord | Int32 |
maxRecords | Int32 |
srcTable | String |
command | IDbCommand |
behavior | CommandBehavior |
Returns | |
---|---|
Type | Description |
Int32 |
Fill(DataSet, String, IDataReader, Int32, Int32)
protected override int Fill(DataSet dataSet, string srcTable, IDataReader dataReader, int startRecord, int maxRecords)
Parameters | |
---|---|
Name | Description |
dataSet | DataSet |
srcTable | String |
dataReader | IDataReader |
startRecord | Int32 |
maxRecords | Int32 |
Returns | |
---|---|
Type | Description |
Int32 |
OnRowUpdated(RowUpdatedEventArgs)
protected override void OnRowUpdated(RowUpdatedEventArgs rowUpdatedEventArgs)
Parameter | |
---|---|
Name | Description |
rowUpdatedEventArgs | RowUpdatedEventArgs |
OnRowUpdating(RowUpdatingEventArgs)
protected override void OnRowUpdating(RowUpdatingEventArgs rowUpdatingEventArgs)
Parameter | |
---|---|
Name | Description |
rowUpdatingEventArgs | RowUpdatingEventArgs |
Events
RowUpdated
public event EventHandler<SpannerRowUpdatedEventArgs> RowUpdated
Occurs during Update after a command is executed against the data source.
Event Type | |
---|---|
Type | Description |
EventHandler<SpannerRowUpdatedEventArgs> |
RowUpdating
public event EventHandler<SpannerRowUpdatingEventArgs> RowUpdating
Occurs during Update before a command is executed against the data source.
Event Type | |
---|---|
Type | Description |
EventHandler<SpannerRowUpdatingEventArgs> |
Explicit Interface Implementations
IDbDataAdapter.DeleteCommand
[Browsable(false)]
IDbCommand IDbDataAdapter.DeleteCommand { get; set; }
Returns | |
---|---|
Type | Description |
IDbCommand |
IDbDataAdapter.InsertCommand
[Browsable(false)]
IDbCommand IDbDataAdapter.InsertCommand { get; set; }
Returns | |
---|---|
Type | Description |
IDbCommand |
IDbDataAdapter.SelectCommand
[Browsable(false)]
IDbCommand IDbDataAdapter.SelectCommand { get; set; }
Returns | |
---|---|
Type | Description |
IDbCommand |
IDbDataAdapter.UpdateCommand
[Browsable(false)]
IDbCommand IDbDataAdapter.UpdateCommand { get; set; }
Returns | |
---|---|
Type | Description |
IDbCommand |