Skip to content

Commit

Permalink
Implement DbDataSource (#70006)
Browse files Browse the repository at this point in the history
Closes #64812
  • Loading branch information
roji authored Jun 6, 2022
1 parent 941c81d commit be4d292
Show file tree
Hide file tree
Showing 7 changed files with 653 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/libraries/System.Data.Common/ref/System.Data.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,24 @@ protected DbDataRecord() { }
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetProperties(System.Attribute[]? attributes) { throw null; }
object System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner(System.ComponentModel.PropertyDescriptor? pd) { throw null; }
}
public abstract class DbDataSource : IDisposable, IAsyncDisposable
{
public abstract string ConnectionString { get; }
protected abstract System.Data.Common.DbConnection CreateDbConnection();
protected virtual System.Data.Common.DbConnection OpenDbConnection() { throw null; }
protected virtual System.Threading.Tasks.ValueTask<System.Data.Common.DbConnection> OpenDbConnectionAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
protected virtual System.Data.Common.DbCommand CreateDbCommand(string? commandText = null) { throw null; }
protected virtual System.Data.Common.DbBatch CreateDbBatch() { throw null; }
public System.Data.Common.DbConnection CreateConnection() { throw null; }
public System.Data.Common.DbConnection OpenConnection() { throw null; }
public System.Threading.Tasks.ValueTask<System.Data.Common.DbConnection> OpenConnectionAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
public System.Data.Common.DbCommand CreateCommand(string? commandText = null) { throw null; }
public System.Data.Common.DbBatch CreateBatch() { throw null; }
public void Dispose() { throw null; }
public System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
protected virtual void Dispose(bool disposing) { throw null; }
protected virtual System.Threading.Tasks.ValueTask DisposeAsyncCore() { throw null; }
}
public abstract partial class DbDataSourceEnumerator
{
protected DbDataSourceEnumerator() { }
Expand Down Expand Up @@ -2606,6 +2624,7 @@ protected DbProviderFactory() { }
public virtual System.Data.Common.DbDataAdapter? CreateDataAdapter() { throw null; }
public virtual System.Data.Common.DbDataSourceEnumerator? CreateDataSourceEnumerator() { throw null; }
public virtual System.Data.Common.DbParameter? CreateParameter() { throw null; }
public virtual System.Data.Common.DbDataSource CreateDataSource(string connectionString) { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed partial class DbProviderSpecificTypePropertyAttribute : System.Attribute
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/System.Data.Common/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@
<data name="Expr_InvalidTimeZoneRange" xml:space="preserve"><value>Provided range for time one exceeds total of 14 hours.</value></data>
<data name="Expr_MismatchKindandTimeSpan" xml:space="preserve"><value>Kind property of provided DateTime argument, does not match 'hours' and 'minutes' arguments.</value></data>
<data name="Expr_UnsupportedType" xml:space="preserve"><value>A DataColumn of type '{0}' does not support expression.</value></data>
<data name="Batch_NotSupportedOnDataSourceBatch" xml:space="preserve"><value>Connection and transaction access is not supported on batches created from DbDataSource.</value></data>
<data name="Command_NotSupportedOnDataSourceCommand" xml:space="preserve"><value>Connection and transaction access is not supported on commands created from DbDataSource.</value></data>
<data name="Data_EnforceConstraints" xml:space="preserve"><value>Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.</value></data>
<data name="Data_CannotModifyCollection" xml:space="preserve"><value>Collection itself is not modifiable.</value></data>
<data name="Data_CaseInsensitiveNameConflict" xml:space="preserve"><value>The given name '{0}' matches at least two names in the collection object with different cases, but does not match either of them with the same case.</value></data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
<Compile Include="System\Data\Common\DbDataReader.cs" />
<Compile Include="System\Data\Common\DbDataReaderExtensions.cs" />
<Compile Include="System\Data\Common\DbDataRecord.cs" />
<Compile Include="System\Data\Common\DbDataSource.cs" />
<Compile Include="System\Data\Common\DbDataSourceEnumerator.cs" />
<Compile Include="System\Data\Common\DbEnumerator.cs" />
<Compile Include="System\Data\Common\DbException.cs" />
Expand All @@ -224,6 +225,7 @@
<Compile Include="System\Data\Common\DBSchemaTable.cs" />
<Compile Include="System\Data\Common\DbTransaction.cs" />
<Compile Include="System\Data\Common\DecimalStorage.cs" />
<Compile Include="System\Data\Common\DefaultDataSource.cs" />
<Compile Include="System\Data\Common\DoubleStorage.cs" />
<Compile Include="System\Data\Common\FieldNameLookup.cs" />
<Compile Include="System\Data\Common\Groupbybehavior.cs" />
Expand Down
Loading

0 comments on commit be4d292

Please sign in to comment.