├── .github ├── FUNDING.yml └── workflows │ └── ci.yml ├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── build.ps1 ├── docs ├── ado-net-schema.md ├── ado-net.md ├── batching.md ├── decfloat.md ├── entity-framework-6.md ├── entity-framework-core.md ├── events.md ├── int128.md ├── services-backup.md └── time-zones.md ├── firebird-logo.png ├── header.ps1 ├── include.ps1 ├── license.txt ├── src ├── .editorconfig ├── Directory.Build.props ├── EntityFramework.Firebird.Tests │ ├── EntityFramework.Firebird.Tests.csproj │ ├── EntityFrameworkTestsBase.cs │ ├── FbTestDbContext.cs │ ├── InfrastructureTests.cs │ ├── QueryTests.cs │ └── app.config ├── EntityFramework.Firebird │ ├── App.config.install.xdt │ ├── DefaultFbMigrationSqlGeneratorBehavior.cs │ ├── EntityFramework.Firebird.csproj │ ├── FbConnectionFactory.cs │ ├── FbMigrationSqlGenerator.cs │ ├── FbMigrationsTransactionsInterceptor.cs │ ├── FbProviderManifest.cs │ ├── FbProviderServices.cs │ ├── IFbMigrationSqlGeneratorBehavior.cs │ ├── MetadataHelpers.cs │ ├── Properties │ │ └── EntityFramework.Firebird.snk │ ├── Resources │ │ ├── ProviderManifest.xml │ │ ├── StoreSchemaDefinition.ssdl │ │ ├── StoreSchemaDefinitionVersion3.ssdl │ │ ├── StoreSchemaMapping.msl │ │ └── StoreSchemaMappingVersion3.msl │ ├── SqlGen │ │ ├── DmlSqlGenerator.cs │ │ ├── ExpressionTranslator.cs │ │ ├── FirstClause.cs │ │ ├── ISqlFragment.cs │ │ ├── JoinSymbol.cs │ │ ├── SkipClause.cs │ │ ├── SqlBuilder.cs │ │ ├── SqlGenerator.cs │ │ ├── SqlSelectStatement.cs │ │ ├── SqlWriter.cs │ │ ├── Symbol.cs │ │ ├── SymbolPair.cs │ │ └── SymbolTable.cs │ ├── SsdlToFb.cs │ ├── TypeHelpers.cs │ └── Web.config.install.xdt ├── FirebirdSql.Data.External │ ├── FirebirdSql.Data.External.projitems │ ├── FirebirdSql.Data.External.shproj │ ├── RC4 │ │ ├── ICipherParameters.cs │ │ ├── KeyParameter.cs │ │ └── RC4Engine.cs │ └── zlib │ │ ├── Deflate.cs │ │ ├── InfTree.cs │ │ ├── Inflate.cs │ │ ├── Tree.cs │ │ ├── Zlib.cs │ │ ├── ZlibCodec.cs │ │ └── ZlibConstants.cs ├── FirebirdSql.Data.FirebirdClient.Tests │ ├── AuthBlockTests.cs │ ├── BlobStreamTests.cs │ ├── ConnectionPoolLifetimeHelperTests.cs │ ├── ConnectionStringTests.cs │ ├── FbArrayTests.cs │ ├── FbBatchCommandTests.cs │ ├── FbBlobTests.cs │ ├── FbBooleanSupportTests.cs │ ├── FbCommandBuilderTests.cs │ ├── FbCommandTests.cs │ ├── FbConnectionStringBuilderTests.cs │ ├── FbConnectionTests.cs │ ├── FbDataAdapterTests.cs │ ├── FbDataReaderTests.cs │ ├── FbDatabaseInfoTests.cs │ ├── FbDecFloat16SupportTests.cs │ ├── FbDecFloat34SupportTests.cs │ ├── FbDecFloatTypeTests.cs │ ├── FbExceptionTests.cs │ ├── FbImplicitTransactionTests.cs │ ├── FbInt128SupportTests.cs │ ├── FbLongNumericsSupportTests.cs │ ├── FbParameterCollectionTests.cs │ ├── FbParameterTests.cs │ ├── FbRemoteEventTests.cs │ ├── FbSchemaTests.cs │ ├── FbScriptTests.cs │ ├── FbServicesTests.cs │ ├── FbStoredProcedureCallsTests.cs │ ├── FbTimeZonesSupportTests.cs │ ├── FbTransactionInfoTests.cs │ ├── FbTransactionTests.cs │ ├── FbZonedDateTimeTypeTests.cs │ ├── FbZonedTimeTypeTests.cs │ ├── FirebirdSql.Data.FirebirdClient.Tests.csproj │ ├── GuidTests.cs │ ├── Srp256ClientTests.cs │ ├── SrpClientTests.cs │ ├── TrackerIssuesTests.cs │ └── TransactionScopeTests.cs ├── FirebirdSql.Data.FirebirdClient │ ├── Client │ │ ├── ClientFactory.cs │ │ ├── Managed │ │ │ ├── AuthBlock.cs │ │ │ ├── DataProviderStreamWrapper.cs │ │ │ ├── FetchResponse.cs │ │ │ ├── FirebirdNetworkHandlingWrapper.cs │ │ │ ├── GdsConnection.cs │ │ │ ├── GenericResponse.cs │ │ │ ├── IDataProvider.cs │ │ │ ├── IResponse.cs │ │ │ ├── ITracksIOFailure.cs │ │ │ ├── IXdrReader.cs │ │ │ ├── IXdrWriter.cs │ │ │ ├── ProtocolsSupported.cs │ │ │ ├── SqlResponse.cs │ │ │ ├── Srp │ │ │ │ ├── Srp256Client.cs │ │ │ │ ├── SrpClient.cs │ │ │ │ └── SrpClientBase.cs │ │ │ ├── Sspi │ │ │ │ └── SspiHelper.cs │ │ │ ├── Version10 │ │ │ │ ├── GdsArray.cs │ │ │ │ ├── GdsBlob.cs │ │ │ │ ├── GdsDatabase.cs │ │ │ │ ├── GdsEventManager.cs │ │ │ │ ├── GdsServiceManager.cs │ │ │ │ ├── GdsStatement.cs │ │ │ │ └── GdsTransaction.cs │ │ │ ├── Version11 │ │ │ │ ├── AuthResponse.cs │ │ │ │ ├── GdsDatabase.cs │ │ │ │ ├── GdsServiceManager.cs │ │ │ │ └── GdsStatement.cs │ │ │ ├── Version12 │ │ │ │ ├── GdsDatabase.cs │ │ │ │ ├── GdsServiceManager.cs │ │ │ │ └── GdsStatement.cs │ │ │ ├── Version13 │ │ │ │ ├── ContAuthResponse.cs │ │ │ │ ├── CryptKeyCallbackResponse.cs │ │ │ │ ├── GdsDatabase.cs │ │ │ │ ├── GdsServiceManager.cs │ │ │ │ ├── GdsStatement.cs │ │ │ │ └── WireCryptOption.cs │ │ │ ├── Version15 │ │ │ │ ├── CryptKeyCallbackResponse.cs │ │ │ │ ├── GdsDatabase.cs │ │ │ │ ├── GdsServiceManager.cs │ │ │ │ └── GdsStatement.cs │ │ │ ├── Version16 │ │ │ │ ├── BatchCompletionStateResponse.cs │ │ │ │ ├── GdsBatch.cs │ │ │ │ ├── GdsDatabase.cs │ │ │ │ ├── GdsServiceManager.cs │ │ │ │ └── GdsStatement.cs │ │ │ └── XdrReaderWriter.cs │ │ └── Native │ │ │ ├── FbClientFactory.cs │ │ │ ├── FesArray.cs │ │ │ ├── FesBlob.cs │ │ │ ├── FesConnection.cs │ │ │ ├── FesDatabase.cs │ │ │ ├── FesServiceManager.cs │ │ │ ├── FesStatement.cs │ │ │ ├── FesTransaction.cs │ │ │ ├── Handles │ │ │ ├── BlobHandle.cs │ │ │ ├── DatabaseHandle.cs │ │ │ ├── FirebirdHandle.cs │ │ │ ├── IFirebirdHandle.cs │ │ │ ├── StatementHandle.cs │ │ │ └── TransactionHandle.cs │ │ │ ├── IFbClient.cs │ │ │ ├── Marshalers │ │ │ ├── ArrayBoundMarshal.cs │ │ │ ├── ArrayDescMarshal.cs │ │ │ ├── ArrayDescMarshaler.cs │ │ │ ├── XSQLDA.cs │ │ │ ├── XSQLVAR.cs │ │ │ └── XsqldaMarshaler.cs │ │ │ └── StatusVectorHelper.cs │ ├── Common │ │ ├── ArrayBase.cs │ │ ├── ArrayBound.cs │ │ ├── ArrayDesc.cs │ │ ├── BatchBase.cs │ │ ├── BatchParameterBuffer.cs │ │ ├── BinaryEncoding.cs │ │ ├── BlobBase.cs │ │ ├── BlobParameterBuffer.cs │ │ ├── BlobStream.cs │ │ ├── Charset.cs │ │ ├── ConnectionPoolLifetimeHelper.cs │ │ ├── ConnectionString.cs │ │ ├── DatabaseBase.cs │ │ ├── DatabaseParameterBuffer1.cs │ │ ├── DatabaseParameterBuffer2.cs │ │ ├── DatabaseParameterBufferBase.cs │ │ ├── DateTime2.cs │ │ ├── DbDataType.cs │ │ ├── DbField.cs │ │ ├── DbStatementType.cs │ │ ├── DbValue.cs │ │ ├── DecimalCodec.cs │ │ ├── DecimalShiftHelper.cs │ │ ├── DecimalType.cs │ │ ├── DenselyPackedDecimalCodec.cs │ │ ├── Descriptor.cs │ │ ├── EmptyDescriptorFiller.cs │ │ ├── Encoding2.cs │ │ ├── EventParameterBuffer.cs │ │ ├── ExplicitCancellation.cs │ │ ├── Extensions.cs │ │ ├── IDescriptorFiller.cs │ │ ├── InfoValuesConverter.cs │ │ ├── Int128Helper.cs │ │ ├── IscCodes.cs │ │ ├── IscError.cs │ │ ├── IscErrorMessages.cs │ │ ├── IscException.cs │ │ ├── IscHelper.cs │ │ ├── NamedParametersParser.cs │ │ ├── NativeHelpers.cs │ │ ├── ParameterBuffer.cs │ │ ├── RemoteEvent.cs │ │ ├── ServiceManagerBase.cs │ │ ├── ServiceParameterBuffer2.cs │ │ ├── ServiceParameterBuffer3.cs │ │ ├── ServiceParameterBufferBase.cs │ │ ├── ShutdownHelper.cs │ │ ├── SizeHelper.cs │ │ ├── SqlStateMapping.cs │ │ ├── StatementBase.cs │ │ ├── StatementState.cs │ │ ├── TimeZoneMapping.cs │ │ ├── TransactionBase.cs │ │ ├── TransactionParameterBuffer.cs │ │ ├── TransactionState.cs │ │ ├── TypeDecoder.cs │ │ ├── TypeEncoder.cs │ │ ├── TypeHelper.cs │ │ └── ValueTask2.cs │ ├── FirebirdClient │ │ ├── FbBatchCommand.cs │ │ ├── FbBatchNonQueryResult.cs │ │ ├── FbBatchParameterCollection.cs │ │ ├── FbCharset.cs │ │ ├── FbCommand.cs │ │ ├── FbCommandBuilder.cs │ │ ├── FbConnection.cs │ │ ├── FbConnectionInternal.cs │ │ ├── FbConnectionPoolManager.cs │ │ ├── FbConnectionStringBuilder.cs │ │ ├── FbDataAdapter.cs │ │ ├── FbDataReader.cs │ │ ├── FbDatabaseInfo.cs │ │ ├── FbDbType.cs │ │ ├── FbEnlistmentNotification.cs │ │ ├── FbError.cs │ │ ├── FbErrorCollection.cs │ │ ├── FbException.cs │ │ ├── FbInfoMessageEventArgs.cs │ │ ├── FbParameter.cs │ │ ├── FbParameterCollection.cs │ │ ├── FbRemoteEvent.cs │ │ ├── FbRemoteEventCountsEventArgs.cs │ │ ├── FbRemoteEventErrorEventArgs.cs │ │ ├── FbRowUpdatedEventArgs.cs │ │ ├── FbRowUpdatingEventArgs.cs │ │ ├── FbServerType.cs │ │ ├── FbTransaction.cs │ │ ├── FbTransactionBehavior.cs │ │ ├── FbTransactionInfo.cs │ │ ├── FbTransactionOptions.cs │ │ ├── FbWireCrypt.cs │ │ ├── FirebirdClientFactory.cs │ │ └── IFbPreparedCommand.cs │ ├── FirebirdSql.Data.FirebirdClient.csproj │ ├── Isql │ │ ├── CommandExecutedEventArgs.cs │ │ ├── CommandExecutingEventArgs.cs │ │ ├── FbBatchExecution.cs │ │ ├── FbScript.cs │ │ ├── FbStatement.cs │ │ ├── FbStatementCollection.cs │ │ ├── SqlStatementType.cs │ │ ├── SqlStringParser.cs │ │ └── UnknownStatementEventArgs.cs │ ├── Logging │ │ ├── ConsoleLoggingProvider.cs │ │ ├── FbLogLevel.cs │ │ ├── FbLogManager.cs │ │ ├── IFbLogger.cs │ │ ├── IFbLoggingProvider.cs │ │ ├── LogMessages.cs │ │ └── NullLoggingProvider.cs │ ├── Properties │ │ ├── ComAssemblyInfo.cs │ │ ├── FirebirdSql.Data.FirebirdClient.snk │ │ └── InternalsVisibleToAssemblyInfo.cs │ ├── Schema │ │ ├── FbCharacterSets.cs │ │ ├── FbCheckConstraints.cs │ │ ├── FbChecksByTable.cs │ │ ├── FbCollations.cs │ │ ├── FbColumnPrivileges.cs │ │ ├── FbColumns.cs │ │ ├── FbDomains.cs │ │ ├── FbForeignKeyColumns.cs │ │ ├── FbForeignKeys.cs │ │ ├── FbFunctionArguments.cs │ │ ├── FbFunctionPrivileges.cs │ │ ├── FbFunctions.cs │ │ ├── FbGenerators.cs │ │ ├── FbIndexColumns.cs │ │ ├── FbIndexes.cs │ │ ├── FbMetaData.xml │ │ ├── FbPrimaryKeys.cs │ │ ├── FbProcedureParameters.cs │ │ ├── FbProcedurePrivileges.cs │ │ ├── FbProcedures.cs │ │ ├── FbRoles.cs │ │ ├── FbSchema.cs │ │ ├── FbSchemaFactory.cs │ │ ├── FbTableConstraints.cs │ │ ├── FbTablePrivileges.cs │ │ ├── FbTables.cs │ │ ├── FbTriggers.cs │ │ ├── FbUniqueKeys.cs │ │ ├── FbViewColumns.cs │ │ ├── FbViewPrivileges.cs │ │ └── FbViews.cs │ ├── Services │ │ ├── FbBackup.cs │ │ ├── FbBackupFile.cs │ │ ├── FbBackupFileCollection.cs │ │ ├── FbBackupFlags.cs │ │ ├── FbBackupRestoreStatistics.cs │ │ ├── FbConfiguration.cs │ │ ├── FbDatabaseTraceConfiguration.cs │ │ ├── FbDatabaseTraceConfigurationCollection.cs │ │ ├── FbDatabaseTraceEvents.cs │ │ ├── FbDatabasesInfo.cs │ │ ├── FbLog.cs │ │ ├── FbNBackup.cs │ │ ├── FbNBackupFlags.cs │ │ ├── FbNFixup.cs │ │ ├── FbNRestore.cs │ │ ├── FbRestore.cs │ │ ├── FbRestoreFlags.cs │ │ ├── FbSecurity.cs │ │ ├── FbServerConfig.cs │ │ ├── FbServerProperties.cs │ │ ├── FbService.cs │ │ ├── FbServiceState.cs │ │ ├── FbServiceTraceConfiguration.cs │ │ ├── FbServiceTraceEvents.cs │ │ ├── FbShutdownMode.cs │ │ ├── FbShutdownOnlineMode.cs │ │ ├── FbShutdownType.cs │ │ ├── FbStatistical.cs │ │ ├── FbStatisticalFlags.cs │ │ ├── FbStreamingBackup.cs │ │ ├── FbStreamingRestore.cs │ │ ├── FbTrace.cs │ │ ├── FbTraceConfiguration.cs │ │ ├── FbTraceVersion.cs │ │ ├── FbUserData.cs │ │ ├── FbValidation.cs │ │ ├── FbValidation2.cs │ │ ├── FbValidationFlags.cs │ │ └── ServiceOutputEventArgs.cs │ └── Types │ │ ├── FbDecFloat.cs │ │ ├── FbZonedDateTime.cs │ │ └── FbZonedTime.cs ├── FirebirdSql.Data.TestsBase │ ├── FbServerTypeTestFixtureSource.cs │ ├── FbTestsBase.cs │ ├── FbTestsSetup.cs │ ├── FirebirdSql.Data.TestsBase.projitems │ ├── FirebirdSql.Data.TestsBase.shproj │ ├── FirebirdSql.Data.TestsBase.snk │ ├── NoServerCategoryAttribute.cs │ └── Program.cs ├── FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests │ ├── ComplianceFbTest.cs │ ├── FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.csproj │ ├── Helpers │ │ ├── ModelHelpers.cs │ │ ├── SkippingAttributes.cs │ │ └── Xunit.cs │ ├── MigrationsFbTest.cs │ ├── Query │ │ ├── AdHocAdvancedMappingsQueryFbTest.cs │ │ ├── AdHocComplexTypeQueryFbTest.cs │ │ ├── AdHocManyToManyQueryFbTest.cs │ │ ├── AdHocMiscellaneousQueryFbTest.cs │ │ ├── AdHocNavigationsQueryFbTest.cs │ │ ├── AdHocQueryFiltersQueryFbTest.cs │ │ ├── AdHocQuerySplittingQueryFbTest.cs │ │ ├── ComplexNavigationsCollectionsQueryFbTest.cs │ │ ├── ComplexNavigationsCollectionsSharedTypeQueryFbTest.cs │ │ ├── ComplexNavigationsCollectionsSplitQueryFbTest.cs │ │ ├── ComplexNavigationsCollectionsSplitSharedTypeQueryFbTest.cs │ │ ├── ComplexNavigationsQueryFbFixture.cs │ │ ├── ComplexNavigationsQueryFbTest.cs │ │ ├── ComplexNavigationsSharedTypeQueryFbFixture.cs │ │ ├── ComplexNavigationsSharedTypeQueryFbTest.cs │ │ ├── ComplexTypeQueryFbTest.cs │ │ ├── CompositeKeysQueryFbFixture.cs │ │ ├── CompositeKeysQueryFbTest.cs │ │ ├── CompositeKeysSplitQueryFbTest.cs │ │ ├── Ef6GroupByFbTest.cs │ │ ├── EntitySplittingQueryFbTest.cs │ │ ├── FromSqlQueryFbTest.cs │ │ ├── FromSqlSprocQueryFbTest.cs │ │ ├── FunkyDataQueryFbTest.cs │ │ ├── GearsOfWarFromSqlQueryFbTest.cs │ │ ├── GearsOfWarQueryFbFixture.cs │ │ ├── GearsOfWarQueryFbTest.cs │ │ ├── IncludeOneToOneFbTest.cs │ │ ├── IncompleteMappingInheritanceQueryFbFixture.cs │ │ ├── IncompleteMappingInheritanceQueryFbTest.cs │ │ ├── InheritanceRelationshipsQueryFbTest.cs │ │ ├── ManyToManyNoTrackingQueryFbTest.cs │ │ ├── ManyToManyQueryFbFixture.cs │ │ ├── ManyToManyQueryFbTest.cs │ │ ├── MappingQueryFbTest.cs │ │ ├── NonSharedPrimitiveCollectionsQueryFbTest.cs │ │ ├── NorthwindAggregateOperatorsQueryFbTest.cs │ │ ├── NorthwindAsNoTrackingQueryFbTest.cs │ │ ├── NorthwindAsTrackingQueryFbTest.cs │ │ ├── NorthwindChangeTrackingQueryFbTest.cs │ │ ├── NorthwindCompiledQueryFbTest.cs │ │ ├── NorthwindDbFunctionsQueryFbTest.cs │ │ ├── NorthwindEFPropertyIncludeQueryFbTest.cs │ │ ├── NorthwindFunctionsQueryFbTest.cs │ │ ├── NorthwindGroupByQueryFbTest.cs │ │ ├── NorthwindIncludeNoTrackingQueryFbTest.cs │ │ ├── NorthwindIncludeQueryFbTest.cs │ │ ├── NorthwindJoinQueryFbTest.cs │ │ ├── NorthwindKeylessEntitiesQueryFbTest.cs │ │ ├── NorthwindMiscellaneousQueryFbTest.cs │ │ ├── NorthwindNavigationsQueryFbTest.cs │ │ ├── NorthwindQueryFbFixture.cs │ │ ├── NorthwindQueryFiltersQueryFbTest.cs │ │ ├── NorthwindQueryTaggingQueryFbTest.cs │ │ ├── NorthwindSelectQueryFbTest.cs │ │ ├── NorthwindSetOperationsQueryFbTest.cs │ │ ├── NorthwindSplitIncludeNoTrackingQueryFbTest.cs │ │ ├── NorthwindSplitIncludeQueryFbTest.cs │ │ ├── NorthwindSqlQueryFbTest.cs │ │ ├── NorthwindStringIncludeQueryFbTest.cs │ │ ├── NorthwindWhereQueryFbTest.cs │ │ ├── NullKeysFbTest.cs │ │ ├── NullSemanticsQueryFbFixture.cs │ │ ├── NullSemanticsQueryFbTest.cs │ │ ├── OperatorsProceduralFbTest.cs │ │ ├── OperatorsQueryFbTest.cs │ │ ├── OptionalDependentQueryFbFixture.cs │ │ ├── OptionalDependentQueryFbTest.cs │ │ ├── OwnedEntityQueryFbTest.cs │ │ ├── OwnedQueryFbTest.cs │ │ ├── PrimitiveCollectionsQueryFbTest.cs │ │ ├── QueryFilterFuncletizationFbTest.cs │ │ ├── QueryNoClientEvalFbTest.cs │ │ ├── SharedTypeQueryFbTest.cs │ │ ├── SqlExecutorFbTest.cs │ │ ├── SqlQueryFbTest.cs │ │ ├── TPCFiltersInheritanceQueryFbFixture.cs │ │ ├── TPCFiltersInheritanceQueryFbTest.cs │ │ ├── TPCGearsOfWarQueryFbFixture.cs │ │ ├── TPCGearsOfWarQueryFbTest.cs │ │ ├── TPCInheritanceQueryFbFixture.cs │ │ ├── TPCInheritanceQueryFbFixtureBase.cs │ │ ├── TPCInheritanceQueryFbTest.cs │ │ ├── TPCInheritanceQueryFbTestBase.cs │ │ ├── TPCInheritanceQueryHiLoFbFixture.cs │ │ ├── TPCInheritanceQueryHiLoFbTest.cs │ │ ├── TPCManyToManyNoTrackingQueryFbTest.cs │ │ ├── TPCManyToManyQueryFbFixture.cs │ │ ├── TPCManyToManyQueryFbTest.cs │ │ ├── TPCRelationshipsQueryFbTest.cs │ │ ├── TPHFiltersInheritanceQueryFbFixture.cs │ │ ├── TPHFiltersInheritanceQueryFbTest.cs │ │ ├── TPHInheritanceQueryFbFixture.cs │ │ ├── TPHInheritanceQueryFbTest.cs │ │ ├── TPTFiltersInheritanceQueryFbFixture.cs │ │ ├── TPTFiltersInheritanceQueryFbTest.cs │ │ ├── TPTGearsOfWarQueryFbFixture.cs │ │ ├── TPTGearsOfWarQueryFbTest.cs │ │ ├── TPTInheritanceQueryFbFixture.cs │ │ ├── TPTInheritanceQueryFbTest.cs │ │ ├── TPTManyToManyNoTrackingQueryFbTest.cs │ │ ├── TPTManyToManyQueryFbFixture.cs │ │ ├── TPTManyToManyQueryFbTest.cs │ │ ├── TPTRelationshipsQueryFbTest.cs │ │ ├── ToSqlQueryFbTest.cs │ │ ├── UdfDbFunctionFbTests.cs │ │ └── WarningsFbTest.cs │ ├── TestModels │ │ └── Northwind │ │ │ └── NorthwindFbContext.cs │ ├── TestUtilities │ │ ├── FbPrecompiledQueryTestHelpers.cs │ │ ├── FbTestHelpers.cs │ │ ├── FbTestStore.cs │ │ └── FbTestStoreFactory.cs │ └── UpdatesFbTest.cs ├── FirebirdSql.EntityFrameworkCore.Firebird.Tests │ ├── EndToEnd │ │ ├── DeleteTests.cs │ │ ├── InsertTests.cs │ │ └── UpdateTests.cs │ ├── EntityFrameworkCoreTestsBase.cs │ ├── FbTestDbContext.cs │ ├── FirebirdSql.EntityFrameworkCore.Firebird.Tests.csproj │ ├── Migrations │ │ └── MigrationsTests.cs │ ├── Query │ │ └── ElementaryTests.cs │ └── Scaffolding │ │ └── ScaffoldingTests.cs ├── FirebirdSql.EntityFrameworkCore.Firebird │ ├── Design │ │ └── Internal │ │ │ └── FbDesignTimeServices.cs │ ├── Diagnostics │ │ └── Internal │ │ │ └── FbLoggingDefinitions.cs │ ├── Extensions │ │ ├── FbDatabaseFacadeExtensions.cs │ │ ├── FbDbContextOptionsBuilderExtensions.cs │ │ ├── FbModelBuilderExtensions.cs │ │ ├── FbModelExtensions.cs │ │ ├── FbPropertyBuilderExtensions.cs │ │ ├── FbPropertyExtensions.cs │ │ └── FbServiceCollectionExtensions.cs │ ├── FirebirdSql.EntityFrameworkCore.Firebird.csproj │ ├── Infrastructure │ │ ├── FbDbContextOptionsBuilder.cs │ │ └── Internal │ │ │ ├── FbModelValidator.cs │ │ │ ├── FbOptionsExtension.cs │ │ │ └── IFbOptions.cs │ ├── Internal │ │ └── FbOptions.cs │ ├── Metadata │ │ ├── Conventions │ │ │ ├── FbConventionSetBuilder.cs │ │ │ ├── FbStoreGenerationConvention.cs │ │ │ ├── FbValueGenerationConvention.cs │ │ │ └── FbValueGenerationStrategyConvention.cs │ │ ├── FbValueGenerationStrategy.cs │ │ └── Internal │ │ │ ├── FbAnnotationNames.cs │ │ │ └── FbRelationalAnnotationProvider.cs │ ├── Migrations │ │ ├── FbMigrationSqlGeneratorBehavior.cs │ │ ├── FbMigrationsSqlGenerator.cs │ │ ├── IFbMigrationSqlGeneratorBehavior.cs │ │ └── Internal │ │ │ ├── FbHistoryRepository.cs │ │ │ └── FbMigrationDatabaseLock.cs │ ├── Properties │ │ ├── EntityFrameworkCoreAssemblyInfo.cs │ │ └── FirebirdSql.EntityFrameworkCore.Firebird.snk │ ├── Query │ │ ├── ExpressionTranslators │ │ │ └── Internal │ │ │ │ ├── FbByteArrayMethodTranslator.cs │ │ │ │ ├── FbConvertTranslator.cs │ │ │ │ ├── FbDateAddTranslator.cs │ │ │ │ ├── FbDateOnlyMethodTranslator.cs │ │ │ │ ├── FbDateOnlyPartComponentTranslator.cs │ │ │ │ ├── FbDateTimeDateComponentTranslator.cs │ │ │ │ ├── FbDateTimeNowTodayTranslator.cs │ │ │ │ ├── FbDateTimePartComponentTranslator.cs │ │ │ │ ├── FbMathTranslator.cs │ │ │ │ ├── FbMemberTranslatorProvider.cs │ │ │ │ ├── FbMethodCallTranslatorProvider.cs │ │ │ │ ├── FbNewGuidTranslator.cs │ │ │ │ ├── FbObjectToStringTranslator.cs │ │ │ │ ├── FbStringContainsTranslator.cs │ │ │ │ ├── FbStringEndsWithTranslator.cs │ │ │ │ ├── FbStringFirstOrDefaultTranslator.cs │ │ │ │ ├── FbStringIndexOfTranslator.cs │ │ │ │ ├── FbStringIsNullOrWhiteSpaceTranslator.cs │ │ │ │ ├── FbStringLastOrDefaultTranslator.cs │ │ │ │ ├── FbStringLengthTranslator.cs │ │ │ │ ├── FbStringReplaceTranslator.cs │ │ │ │ ├── FbStringStartsWithTranslator.cs │ │ │ │ ├── FbStringSubstringTranslator.cs │ │ │ │ ├── FbStringToLowerTranslator.cs │ │ │ │ ├── FbStringToUpperTranslator.cs │ │ │ │ ├── FbStringTrimTranslator.cs │ │ │ │ ├── FbTimeOnlyMethodTranslator.cs │ │ │ │ ├── FbTimeOnlyPartComponentTranslator.cs │ │ │ │ └── FbTimeSpanPartComponentTranslator.cs │ │ ├── Expressions │ │ │ └── Internal │ │ │ │ └── FbSpacedFunctionExpression.cs │ │ └── Internal │ │ │ ├── FbQueryRootProcessor.cs │ │ │ ├── FbQuerySqlGenerator.cs │ │ │ ├── FbQuerySqlGeneratorFactory.cs │ │ │ ├── FbQueryTranslationPreprocessor.cs │ │ │ ├── FbQueryTranslationPreprocessorFactory.cs │ │ │ ├── FbSqlExpressionFactory.cs │ │ │ ├── FbSqlTranslatingExpressionVisitor.cs │ │ │ └── FbSqlTranslatingExpressionVisitorFactory.cs │ ├── Scaffolding │ │ └── Internal │ │ │ ├── FbDatabaseModelFactory.cs │ │ │ └── FbProviderCodeGenerator.cs │ ├── Storage │ │ └── Internal │ │ │ ├── FbBoolTypeMapping.cs │ │ │ ├── FbByteArrayTypeMapping.cs │ │ │ ├── FbDatabaseCreator.cs │ │ │ ├── FbDateOnlyTypeMapping.cs │ │ │ ├── FbDateTimeTypeMapping.cs │ │ │ ├── FbGuidTypeMapping.cs │ │ │ ├── FbRelationalConnection.cs │ │ │ ├── FbRelationalTransaction.cs │ │ │ ├── FbSqlGenerationHelper.cs │ │ │ ├── FbStringTypeMapping.cs │ │ │ ├── FbTimeOnlyTypeMapping.cs │ │ │ ├── FbTimeSpanTypeMapping.cs │ │ │ ├── FbTransactionFactory.cs │ │ │ ├── FbTypeMappingSource.cs │ │ │ ├── IFbSqlGenerationHelper.cs │ │ │ ├── IRelationalFbConnection.cs │ │ │ └── IRelationalFbTransaction.cs │ ├── Update │ │ └── Internal │ │ │ ├── FbModificationCommandBatchFactory.cs │ │ │ ├── FbUpdateSqlGenerator.cs │ │ │ └── IFbUpdateSqlGenerator.cs │ ├── Utilities │ │ ├── EnumerableMethods.cs │ │ ├── SharedTypeExtensions.cs │ │ ├── StringBuilderExtensions.cs │ │ └── TranslatorsHelper.cs │ └── ValueGeneration │ │ └── Internal │ │ ├── FbSequenceHiLoValueGenerator.cs │ │ ├── FbSequenceValueGeneratorFactory.cs │ │ ├── FbSequenceValueGeneratorState.cs │ │ ├── FbValueGeneratorCache.cs │ │ ├── FbValueGeneratorSelector.cs │ │ ├── IFbSequenceValueGeneratorFactory.cs │ │ └── IFbValueGeneratorCache.cs ├── NETProvider.sln ├── Perf │ ├── CommandBenchmark.Execute.cs │ ├── CommandBenchmark.Fetch.cs │ ├── CommandBenchmark.cs │ ├── Perf.csproj │ └── Program.cs ├── Scratchpad │ ├── Program.cs │ └── Scratchpad.csproj └── Versions.props └── tests.ps1 /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: cincuranet 2 | custom: https://firebirdsql.org/en/donate/ 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.user 3 | *.lock.json 4 | .vs 5 | bin 6 | obj 7 | out/ 8 | .idea 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for considering contributing. Here are some items to consider before starting (in no particular order). 4 | 5 | * Check [tracker](https://github.com/FirebirdSQL/NETProvider/issues) if you want to start on something. 6 | * Before you start working on something announce your intention on the mailing list (or in comment in tracker). 7 | * Issue only complete PRs (no WIPs). 8 | * Make sure your PR doesn't contain unneccessary changes (whitespaces, new lines, ...). 9 | * Consider squashing your commits. 10 | * Follow existing code formatting/styling (even for new files). 11 | * Make sure you swept all corners (i.e. all build configurations are fine, works with all Firebird version, etc.). 12 | * Make sure your changes merge without conflicts. 13 | * Consider backward compatibility. 14 | * Don't be afraid to ask (i.e. backward compatibility). 15 | * Be prepared to do some changes after your PR is reviewed. 16 | * Consider whether your change is benefit for majority of users (opposite to only a small group). 17 | * All contributions are licensed under [_Initial Developer's Public License_](license.txt). -------------------------------------------------------------------------------- /docs/ado-net-schema.md: -------------------------------------------------------------------------------- 1 | # ADO.NET - Schema 2 | 3 | ### Steps 4 | 5 | * Install `FirebirdSql.Data.FirebirdClient` from NuGet. 6 | * Add `using FirebirdSql.Data.FirebirdClient;`. 7 | 8 | ### Code 9 | 10 | ```csharp 11 | using (var connection = new FbConnection("database=localhost:demo.fdb;user=sysdba;password=masterkey")) 12 | { 13 | connection.Open(); 14 | 15 | var metadataCollections = connection.GetSchema(); 16 | var dataTypes = connection.GetSchema(DbMetaDataCollectionNames.DataTypes); 17 | var dataSourceInformation = connection.GetSchema(DbMetaDataCollectionNames.DataSourceInformation); 18 | var reservedWords = connection.GetSchema(DbMetaDataCollectionNames.ReservedWords); 19 | var userTables = connection.GetSchema("Tables", new string[] { null, null, null, "TABLE" }); 20 | var systemTables = connection.GetSchema("Tables", new string[] { null, null, null, "SYSTEM TABLE" }); 21 | var tableColumns = connection.GetSchema("Columns", new string[] { null, null, "TableName" }); 22 | } 23 | ``` 24 | -------------------------------------------------------------------------------- /docs/ado-net.md: -------------------------------------------------------------------------------- 1 | # ADO.NET 2 | 3 | ### Steps 4 | 5 | * Install `FirebirdSql.Data.FirebirdClient` from NuGet. 6 | * Add `using FirebirdSql.Data.FirebirdClient;`. 7 | * Basic classes are `FbConnection`, `FbTransaction`, `FbCommand` and `FbDataReader`. 8 | * Connection string can be built using `FbConnectionStringBuilder`. 9 | 10 | ### Code 11 | 12 | ```csharp 13 | using (var connection = new FbConnection("database=localhost:demo.fdb;user=sysdba;password=masterkey")) 14 | { 15 | connection.Open(); 16 | using (var transaction = connection.BeginTransaction()) 17 | { 18 | using (var command = new FbCommand("select * from demo", connection, transaction)) 19 | { 20 | using (var reader = command.ExecuteReader()) 21 | { 22 | while (reader.Read()) 23 | { 24 | var values = new object[reader.FieldCount]; 25 | reader.GetValues(values); 26 | Console.WriteLine(string.Join("|", values)); 27 | } 28 | } 29 | } 30 | } 31 | } 32 | ``` 33 | 34 | ### Scripts 35 | 36 | ```sql 37 | create table demo (id int primary key, foobar varchar(20) character set utf8); 38 | ``` 39 | 40 | ```sql 41 | insert into demo values (6, 'FooBar'); 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/decfloat.md: -------------------------------------------------------------------------------- 1 | # DECFLOAT datatype 2 | 3 | `DECFLOAT(16)` and `DECFLOAT(34)` from Firebird 4 is handled by `FbDecFloat` type. `FbDecFloat` can be used as parameter value for `FbParameter`. 4 | 5 | ### Examples 6 | 7 | Examples can be found in [`FbDecFloat16SupportTests`](../src/FirebirdSql.Data.FirebirdClient.Tests/FbDecFloat16SupportTests.cs) and [`FbDecFloat34SupportTests`](../src/FirebirdSql.Data.FirebirdClient.Tests/FbDecFloat34SupportTests.cs). 8 | -------------------------------------------------------------------------------- /docs/events.md: -------------------------------------------------------------------------------- 1 | # Events 2 | 3 | ### Steps 4 | 5 | * Install `FirebirdSql.Data.FirebirdClient` from NuGet. 6 | * Add `using FirebirdSql.Data.FirebirdClient;`. 7 | 8 | ### Code 9 | 10 | ```csharp 11 | using (var events = new FbRemoteEvent("database=localhost:demo.fdb;user=sysdba;password=masterkey")) 12 | { 13 | events.RemoteEventCounts += (sender, e) => Console.WriteLine($"Event: {e.Name} | Counts: {e.Counts}"); 14 | events.RemoteEventError += (sender, e) => Console.WriteLine($"ERROR: {e.Error}"); 15 | events.QueueEvents("EVENT1", "EVENT2", "EVENT3", "EVENT4"); 16 | Console.WriteLine("Listening..."); 17 | Console.ReadLine(); 18 | } 19 | ``` 20 | -------------------------------------------------------------------------------- /docs/int128.md: -------------------------------------------------------------------------------- 1 | # INT128 datatype 2 | 3 | `INT128` from Firebird 4 is handled by regular .NET `BigInteger` type. `BigInteger` can be used as parameter value for `FbParameter`. 4 | 5 | ### Examples 6 | 7 | Examples can be found in [`FbInt128SupportTests`](../src/FirebirdSql.Data.FirebirdClient.Tests/FbInt128SupportTests.cs). 8 | -------------------------------------------------------------------------------- /docs/services-backup.md: -------------------------------------------------------------------------------- 1 | # Services - Backup 2 | 3 | ### Steps 4 | 5 | * Install `FirebirdSql.Data.FirebirdClient` from NuGet. 6 | * Add `using FirebirdSql.Data.Services;`. 7 | 8 | ### Code 9 | 10 | ```csharp 11 | var backup = new FbBackup("database=localhost:demo.fdb;user=sysdba;password=masterkey"); 12 | backup.BackupFiles.Add(new FbBackupFile(@"C:\backup.fbk")); 13 | //backup.Options = ... 14 | backup.Verbose = true; 15 | backup.ServiceOutput += (sender, e) => Console.WriteLine(e.Message); 16 | backup.Execute(); 17 | ``` 18 | 19 | ### More 20 | * `FbRestore` 21 | * `FbStreamingBackup` 22 | * `FbStreamingRestore` -------------------------------------------------------------------------------- /docs/time-zones.md: -------------------------------------------------------------------------------- 1 | # Time zones 2 | 3 | Time zones from Firebird 4 are handled by `FbZonedDateTime` and `FbZonedTime` types respectively. Given the lack of proper support for time zones in .NET (especially cross platform), these types provide the building blocks for developer to work with time zones using some library (i.e. _NodaTime_). Both `FbZonedDateTime` and `FbZonedTime` can be used as parameter value for `FbParameter`. 4 | 5 | ### Examples 6 | 7 | Examples can be found in [`FbTimeZonesSupportTests`](../src/FirebirdSql.Data.FirebirdClient.Tests/FbTimeZonesSupportTests.cs). 8 | -------------------------------------------------------------------------------- /firebird-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/NETProvider/ac0fc7987cd028a875e6399eefb8d4f7b3df0e13/firebird-logo.png -------------------------------------------------------------------------------- /header.ps1: -------------------------------------------------------------------------------- 1 | $LicenseHeader = @" 2 | /* 3 | * The contents of this file are subject to the Initial 4 | * Developer's Public License Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 8 | * 9 | * Software distributed under the License is distributed on 10 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 11 | * express or implied. See the License for the specific 12 | * language governing rights and limitations under the License. 13 | * 14 | * All Rights Reserved. 15 | */ 16 | "@ 17 | 18 | $baseDir = Split-Path -Parent $PSCommandPath 19 | 20 | gci $baseDir -Recurse -Filter *.cs | %{ 21 | $content = gc $_.FullName -Encoding UTF8 22 | $newContent = @() 23 | 24 | $started = $false 25 | foreach ($line in $content) { 26 | if ($line.StartsWith('//$Authors')) { 27 | $started = $true 28 | $line = $LicenseHeader + "`r`n`r`n" + $line 29 | } 30 | if ($started) { 31 | $newContent += $line 32 | } 33 | } 34 | if (!$started) { 35 | #echo $_.FullName 36 | return 37 | } 38 | 39 | sc $_.FullName $newContent -Encoding UTF8 40 | } -------------------------------------------------------------------------------- /include.ps1: -------------------------------------------------------------------------------- 1 | function Check-ExitCode() { 2 | $exitCode = $LASTEXITCODE 3 | if ($exitCode -ne 0) { 4 | echo "Non-zero ($exitCode) exit code. Exiting..." 5 | exit $exitCode 6 | } 7 | } -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | indent_size = 4 6 | trim_trailing_whitespace = true 7 | 8 | [*.cs] 9 | dotnet_sort_system_directives_first = true 10 | dotnet_separate_import_directive_groups = false 11 | csharp_style_implicit_object_creation_when_type_is_apparent = false 12 | csharp_prefer_simple_using_statement = false -------------------------------------------------------------------------------- /src/EntityFramework.Firebird.Tests/FbTestDbContext.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Data.Entity; 19 | using FirebirdSql.Data.FirebirdClient; 20 | 21 | namespace EntityFramework.Firebird.Tests; 22 | 23 | public class FbTestDbContext : DbContext 24 | { 25 | public class Conf : DbConfiguration 26 | { 27 | public Conf() 28 | { 29 | SetProviderServices(FbProviderServices.ProviderInvariantName, FbProviderServices.Instance); 30 | } 31 | } 32 | 33 | public FbTestDbContext(FbConnection conn) 34 | : base(conn, false) 35 | { } 36 | } 37 | -------------------------------------------------------------------------------- /src/EntityFramework.Firebird.Tests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/EntityFramework.Firebird/App.config.install.xdt: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/EntityFramework.Firebird/IFbMigrationSqlGeneratorBehavior.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Collections.Generic; 19 | 20 | namespace EntityFramework.Firebird; 21 | 22 | public interface IFbMigrationSqlGeneratorBehavior 23 | { 24 | IEnumerable CreateIdentityForColumn(string columnName, string tableName); 25 | IEnumerable DropIdentityForColumn(string columnName, string tableName); 26 | } 27 | -------------------------------------------------------------------------------- /src/EntityFramework.Firebird/Properties/EntityFramework.Firebird.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/NETProvider/ac0fc7987cd028a875e6399eefb8d4f7b3df0e13/src/EntityFramework.Firebird/Properties/EntityFramework.Firebird.snk -------------------------------------------------------------------------------- /src/EntityFramework.Firebird/SqlGen/ISqlFragment.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace EntityFramework.Firebird.SqlGen; 19 | 20 | internal interface ISqlFragment 21 | { 22 | void WriteSql(SqlWriter writer, SqlGenerator sqlGenerator); 23 | } 24 | -------------------------------------------------------------------------------- /src/EntityFramework.Firebird/Web.config.install.xdt: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.External/FirebirdSql.Data.External.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 884ee120-b22e-4940-8c1c-626f13028376 7 | 8 | 9 | FirebirdSql.Data.External 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.External/FirebirdSql.Data.External.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 884ee120-b22e-4940-8c1c-626f13028376 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.External/RC4/ICipherParameters.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Org.BouncyCastle.Crypto 4 | { 5 | /** 6 | * all parameter classes implement this. 7 | */ 8 | internal interface ICipherParameters 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.External/RC4/KeyParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Org.BouncyCastle.Crypto; 4 | 5 | namespace Org.BouncyCastle.Crypto.Parameters 6 | { 7 | internal class KeyParameter 8 | : ICipherParameters 9 | { 10 | private readonly byte[] key; 11 | 12 | public KeyParameter( 13 | byte[] key) 14 | { 15 | if (key == null) 16 | throw new ArgumentNullException("key"); 17 | 18 | this.key = (byte[]) key.Clone(); 19 | } 20 | 21 | public KeyParameter( 22 | byte[] key, 23 | int keyOff, 24 | int keyLen) 25 | { 26 | if (key == null) 27 | throw new ArgumentNullException("key"); 28 | if (keyOff < 0 || keyOff > key.Length) 29 | throw new ArgumentOutOfRangeException("keyOff"); 30 | if (keyLen < 0 || keyLen > (key.Length - keyOff)) 31 | throw new ArgumentOutOfRangeException("keyLen"); 32 | 33 | this.key = new byte[keyLen]; 34 | Array.Copy(key, keyOff, this.key, 0, keyLen); 35 | } 36 | 37 | public byte[] GetKey() 38 | { 39 | return (byte[]) key.Clone(); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient.Tests/ConnectionPoolLifetimeHelperTests.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = @realic, Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.Data.Common; 19 | using FirebirdSql.Data.TestsBase; 20 | using NUnit.Framework; 21 | 22 | namespace FirebirdSql.Data.FirebirdClient.Tests; 23 | 24 | [NoServerCategory] 25 | public class ConnectionPoolLifetimeHelperTests 26 | { 27 | [Test] 28 | public void IsAliveTrueIfLifetimeNotExceed() 29 | { 30 | var now = 1_000_000; 31 | var timeAgo = now - (10 * 1000); 32 | var isAlive = ConnectionPoolLifetimeHelper.IsAlive(20, timeAgo, now); 33 | Assert.IsTrue(isAlive); 34 | } 35 | 36 | [Test] 37 | public void IsAliveFalseIfLifetimeIsExceed() 38 | { 39 | var now = 1_000_000; 40 | var timeAgo = now - (30 * 1000); 41 | var isAlive = ConnectionPoolLifetimeHelper.IsAlive(20, timeAgo, now); 42 | Assert.IsFalse(isAlive); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/FetchResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.Data.Common; 20 | 21 | namespace FirebirdSql.Data.Client.Managed; 22 | 23 | internal class FetchResponse : IResponse 24 | { 25 | public int Status { get; } 26 | public int Count { get; } 27 | 28 | public FetchResponse(int status, int count) 29 | { 30 | Status = status; 31 | Count = count; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/GenericResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.Data.Common; 20 | 21 | namespace FirebirdSql.Data.Client.Managed; 22 | 23 | internal sealed class GenericResponse : IResponse 24 | { 25 | public int ObjectHandle { get; } 26 | public long BlobId { get; } 27 | public byte[] Data { get; } 28 | public IscException Exception { get; } 29 | 30 | public GenericResponse(int objectHandle, long blobId, byte[] data, IscException exception) 31 | { 32 | ObjectHandle = objectHandle; 33 | BlobId = blobId; 34 | Data = data; 35 | Exception = exception; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/IDataProvider.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Threading; 19 | using System.Threading.Tasks; 20 | 21 | namespace FirebirdSql.Data.Client.Managed; 22 | 23 | interface IDataProvider 24 | { 25 | int Read(byte[] buffer, int offset, int count); 26 | ValueTask ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default); 27 | 28 | void Write(byte[] buffer, int offset, int count); 29 | ValueTask WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default); 30 | 31 | void Flush(); 32 | ValueTask FlushAsync(CancellationToken cancellationToken = default); 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/ITracksIOFailure.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.Data.Client.Managed; 19 | 20 | interface ITracksIOFailure 21 | { 22 | bool IOFailed { get; set; } 23 | } 24 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/SqlResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.Data.Common; 20 | 21 | namespace FirebirdSql.Data.Client.Managed; 22 | 23 | internal class SqlResponse : IResponse 24 | { 25 | public int Count { get; } 26 | 27 | public SqlResponse(int count) 28 | { 29 | Count = count; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Srp/Srp256Client.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Linq; 19 | using System.Security.Cryptography; 20 | 21 | namespace FirebirdSql.Data.Client.Managed.Srp; 22 | 23 | internal sealed class Srp256Client : SrpClientBase 24 | { 25 | public override string Name => "Srp256"; 26 | 27 | protected override byte[] ComputeHash(params byte[][] ba) 28 | { 29 | using (var hash = SHA256.Create()) 30 | { 31 | return hash.ComputeHash(ba.SelectMany(x => x).ToArray()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Srp/SrpClient.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Linq; 19 | using System.Security.Cryptography; 20 | 21 | namespace FirebirdSql.Data.Client.Managed.Srp; 22 | 23 | internal sealed class SrpClient : SrpClientBase 24 | { 25 | public override string Name => "Srp"; 26 | 27 | protected override byte[] ComputeHash(params byte[][] ba) 28 | { 29 | using (var hash = SHA1.Create()) 30 | { 31 | return hash.ComputeHash(ba.SelectMany(x => x).ToArray()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version11/AuthResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Vladimir Bodecek, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.Data.Client.Managed; 20 | 21 | namespace FirebirdSql.Data.Client.Managed.Version11; 22 | 23 | internal class AuthResponse : IResponse 24 | { 25 | public byte[] Data { get; } 26 | 27 | public AuthResponse(byte[] data) 28 | { 29 | Data = data; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version11/GdsServiceManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.Data.Common; 19 | 20 | namespace FirebirdSql.Data.Client.Managed.Version11; 21 | 22 | internal class GdsServiceManager : Version10.GdsServiceManager 23 | { 24 | public GdsServiceManager(GdsConnection connection) 25 | : base(connection) 26 | { } 27 | 28 | protected override Version10.GdsDatabase CreateDatabase(GdsConnection connection) 29 | { 30 | return new GdsDatabase(connection); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version12/GdsServiceManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.Data.Common; 19 | 20 | namespace FirebirdSql.Data.Client.Managed.Version12; 21 | 22 | internal class GdsServiceManager : Version11.GdsServiceManager 23 | { 24 | public GdsServiceManager(GdsConnection connection) 25 | : base(connection) 26 | { } 27 | 28 | protected override Version10.GdsDatabase CreateDatabase(GdsConnection connection) 29 | { 30 | return new GdsDatabase(connection); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version13/ContAuthResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Client.Managed.Version13; 21 | 22 | internal class ContAuthResponse : IResponse 23 | { 24 | public byte[] ServerData { get; } 25 | public string AcceptPluginName { get; } 26 | public bool IsAuthenticated { get; } 27 | public byte[] ServerKeys { get; } 28 | 29 | public ContAuthResponse(byte[] serverData, string acceptPluginName, bool isAuthenticated, byte[] serverKeys) 30 | { 31 | ServerData = serverData; 32 | AcceptPluginName = acceptPluginName; 33 | IsAuthenticated = isAuthenticated; 34 | ServerKeys = serverKeys; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version13/CryptKeyCallbackResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.Data.Client.Managed; 20 | 21 | namespace FirebirdSql.Data.Client.Managed.Version13; 22 | 23 | internal class CryptKeyCallbackResponse : IResponse 24 | { 25 | public byte[] Data { get; } 26 | 27 | public CryptKeyCallbackResponse(byte[] data) 28 | { 29 | Data = data; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version13/WireCryptOption.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.Data.Client.Managed.Version13; 19 | 20 | internal enum WireCryptOption 21 | { 22 | Disabled, 23 | Enabled, 24 | Required, 25 | } 26 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version15/CryptKeyCallbackResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.Data.Client.Managed; 20 | 21 | namespace FirebirdSql.Data.Client.Managed.Version15; 22 | 23 | internal class CryptKeyCallbackResponse : IResponse 24 | { 25 | public byte[] Data { get; } 26 | public int Size { get; } 27 | 28 | public CryptKeyCallbackResponse(byte[] data, int size) 29 | { 30 | Data = data; 31 | Size = size; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version15/GdsServiceManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.IO; 19 | using System.Linq; 20 | using System.Threading; 21 | using System.Threading.Tasks; 22 | using FirebirdSql.Data.Common; 23 | 24 | namespace FirebirdSql.Data.Client.Managed.Version15; 25 | 26 | internal class GdsServiceManager : Version13.GdsServiceManager 27 | { 28 | public GdsServiceManager(GdsConnection connection) 29 | : base(connection) 30 | { } 31 | 32 | protected override Version10.GdsDatabase CreateDatabase(GdsConnection connection) 33 | { 34 | return new GdsDatabase(connection); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version15/GdsStatement.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Collections; 20 | using System.IO; 21 | using System.Threading; 22 | using System.Threading.Tasks; 23 | using FirebirdSql.Data.Common; 24 | 25 | namespace FirebirdSql.Data.Client.Managed.Version15; 26 | 27 | internal class GdsStatement : Version13.GdsStatement 28 | { 29 | public GdsStatement(GdsDatabase database) 30 | : base(database) 31 | { } 32 | 33 | public GdsStatement(GdsDatabase database, Version10.GdsTransaction transaction) 34 | : base(database, transaction) 35 | { } 36 | } 37 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version16/GdsServiceManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.IO; 19 | using System.Linq; 20 | using System.Threading; 21 | using System.Threading.Tasks; 22 | using FirebirdSql.Data.Common; 23 | 24 | namespace FirebirdSql.Data.Client.Managed.Version16; 25 | 26 | internal class GdsServiceManager : Version15.GdsServiceManager 27 | { 28 | public GdsServiceManager(GdsConnection connection) 29 | : base(connection) 30 | { } 31 | 32 | protected override Version10.GdsDatabase CreateDatabase(GdsConnection connection) 33 | { 34 | return new GdsDatabase(connection); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Native/FesConnection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Text; 20 | using System.Text.RegularExpressions; 21 | 22 | namespace FirebirdSql.Data.Client.Native; 23 | 24 | internal sealed class FesConnection 25 | { 26 | private FesConnection() 27 | { } 28 | 29 | public static Version GetClientVersion(IFbClient fbClient) 30 | { 31 | var sb = new StringBuilder(64); 32 | fbClient.isc_get_client_version(sb); 33 | var version = sb.ToString(); 34 | var m = Regex.Match(version, @"Firebird (\d+.\d+)"); 35 | if (!m.Success) 36 | return null; 37 | return new Version(m.Groups[1].Value); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Native/Handles/IFirebirdHandle.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Hennadii Zabula 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Client.Native.Handles; 21 | 22 | // public visibility added, because auto-generated assembly can't work with internal types 23 | public interface IFirebirdHandle 24 | { 25 | void SetClient(IFbClient fbClient); 26 | } 27 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Native/Marshalers/ArrayBoundMarshal.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Runtime.InteropServices; 19 | 20 | namespace FirebirdSql.Data.Client.Native.Marshalers; 21 | 22 | [StructLayout(LayoutKind.Sequential)] 23 | internal struct ArrayBoundMarshal 24 | { 25 | public short LowerBound; 26 | public short UpperBound; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Native/Marshalers/ArrayDescMarshal.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Runtime.InteropServices; 19 | 20 | namespace FirebirdSql.Data.Client.Native.Marshalers; 21 | 22 | [StructLayout(LayoutKind.Sequential)] 23 | internal struct ArrayDescMarshal 24 | { 25 | public byte DataType; 26 | public byte Scale; 27 | public short Length; 28 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] 29 | public string FieldName; 30 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] 31 | public string RelationName; 32 | public short Dimensions; 33 | public short Flags; 34 | 35 | public static int ComputeLength(int n) 36 | { 37 | return Marshal.SizeOf() + n * Marshal.SizeOf(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Client/Native/Marshalers/XSQLDA.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Runtime.InteropServices; 19 | 20 | namespace FirebirdSql.Data.Client.Native.Marshalers; 21 | 22 | [StructLayout(LayoutKind.Sequential)] 23 | internal struct XSQLDA 24 | { 25 | public short version; 26 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] 27 | public string sqldaid; 28 | public int sqldabc; 29 | public short sqln; 30 | public short sqld; 31 | } 32 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/ArrayBound.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Runtime.InteropServices; 20 | 21 | namespace FirebirdSql.Data.Common; 22 | 23 | [StructLayout(LayoutKind.Auto)] 24 | internal struct ArrayBound 25 | { 26 | public int LowerBound { get; set; } 27 | public int UpperBound { get; set; } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/ArrayDesc.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Runtime.InteropServices; 20 | 21 | namespace FirebirdSql.Data.Common; 22 | 23 | [StructLayout(LayoutKind.Auto)] 24 | internal struct ArrayDesc 25 | { 26 | public byte DataType { get; set; } 27 | public short Scale { get; set; } 28 | public short Length { get; set; } 29 | public string FieldName { get; set; } 30 | public string RelationName { get; set; } 31 | public short Dimensions { get; set; } 32 | // Specifies wheter array is to be accesed in 33 | // row mayor or column-mayor order 34 | public short Flags { get; set; } 35 | public ArrayBound[] Bounds { get; set; } 36 | } 37 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/BlobParameterBuffer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Text; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal sealed class BlobParameterBuffer : ParameterBuffer 23 | { 24 | public BlobParameterBuffer(Encoding encoding) 25 | { 26 | Encoding = encoding; 27 | } 28 | 29 | public Encoding Encoding { get; } 30 | } 31 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/ConnectionPoolLifetimeHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = @realic, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal static class ConnectionPoolLifetimeHelper 23 | { 24 | internal static bool IsAlive(long connectionLifetime, long created, long now) 25 | { 26 | if (connectionLifetime == 0) 27 | return true; 28 | return (now - created) < (connectionLifetime * 1000); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/DatabaseParameterBufferBase.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Text; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal abstract class DatabaseParameterBufferBase : ParameterBuffer 23 | { 24 | public DatabaseParameterBufferBase(int version, Encoding encoding) 25 | { 26 | Encoding = encoding; 27 | Append(version); 28 | } 29 | 30 | public abstract void Append(int type, byte value); 31 | public abstract void Append(int type, short value); 32 | public abstract void Append(int type, int value); 33 | public abstract void Append(int type, byte[] buffer); 34 | 35 | public void Append(int type, string content) => Append(type, Encoding.GetBytes(content)); 36 | 37 | public Encoding Encoding { get; } 38 | } 39 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/DateTime2.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal static class DateTime2 23 | { 24 | public static DateTime UnixEpoch => 25 | #if NET48 || NETSTANDARD2_0 26 | new DateTime(621355968000000000); 27 | #else 28 | DateTime.UnixEpoch; 29 | #endif 30 | } 31 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/DbDataType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal enum DbDataType 23 | { 24 | Array, 25 | BigInt, 26 | Binary, 27 | Boolean, 28 | Char, 29 | Date, 30 | Decimal, 31 | Double, 32 | Float, 33 | Guid, 34 | Integer, 35 | Numeric, 36 | SmallInt, 37 | Text, 38 | Time, 39 | TimeStamp, 40 | VarChar, 41 | TimeStampTZ, 42 | TimeStampTZEx, 43 | TimeTZ, 44 | TimeTZEx, 45 | Dec16, 46 | Dec34, 47 | Int128, 48 | Null, 49 | } 50 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/DecimalShiftHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.Data.Common; 19 | 20 | internal static class DecimalShiftHelper 21 | { 22 | public static decimal ShiftDecimalLeft(decimal d, int shift) 23 | { 24 | while (shift-- > 0) 25 | { 26 | d /= 10; 27 | } 28 | return d; 29 | } 30 | 31 | public static decimal ShiftDecimalRight(decimal d, int shift) 32 | { 33 | while (shift-- > 0) 34 | { 35 | d *= 10; 36 | } 37 | return d; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/DecimalType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.Data.Common; 19 | 20 | public enum DecimalType 21 | { 22 | Finite, 23 | Infinity, 24 | NaN, 25 | SignalingNaN, 26 | } 27 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/EmptyDescriptorFiller.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Threading; 19 | using System.Threading.Tasks; 20 | 21 | namespace FirebirdSql.Data.Common; 22 | 23 | internal sealed class EmptyDescriptorFiller : IDescriptorFiller 24 | { 25 | public static readonly EmptyDescriptorFiller Instance = new EmptyDescriptorFiller(); 26 | 27 | private EmptyDescriptorFiller() 28 | { } 29 | 30 | public void Fill(Descriptor descriptor, int index) 31 | { } 32 | 33 | public ValueTask FillAsync(Descriptor descriptor, int index, CancellationToken cancellationToken = default) 34 | { 35 | return ValueTask2.CompletedTask; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/Encoding2.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Globalization; 20 | using System.Text; 21 | 22 | namespace FirebirdSql.Data.Common; 23 | 24 | internal static class Encoding2 25 | { 26 | public static Encoding Default { get; } = GetANSIEncoding(); 27 | 28 | private static Encoding GetANSIEncoding() 29 | { 30 | #if NET48 31 | return Encoding.Default; 32 | #else 33 | try 34 | { 35 | return Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.ANSICodePage); 36 | } 37 | catch (Exception) 38 | { 39 | return Encoding.Default; 40 | } 41 | #endif 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/EventParameterBuffer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Text; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal sealed class EventParameterBuffer : ParameterBuffer 23 | { 24 | public EventParameterBuffer(Encoding encoding) 25 | { 26 | Encoding = encoding; 27 | } 28 | 29 | public void Append(byte[] content, int actualCount) 30 | { 31 | WriteByte(content.Length); 32 | Write(content); 33 | Write(actualCount); 34 | } 35 | 36 | public void Append(string content, int actualCount) 37 | { 38 | Append(Encoding.GetBytes(content), actualCount); 39 | } 40 | 41 | public Encoding Encoding { get; } 42 | } 43 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/IDescriptorFiller.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Threading; 19 | using System.Threading.Tasks; 20 | 21 | namespace FirebirdSql.Data.Common; 22 | 23 | internal interface IDescriptorFiller 24 | { 25 | void Fill(Descriptor descriptor, int index); 26 | ValueTask FillAsync(Descriptor descriptor, int index, CancellationToken cancellationToken = default); 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/InfoValuesConverter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal static class InfoValuesHelper 23 | { 24 | public static T ConvertValue(object value) => value is IConvertible ? (T)Convert.ChangeType(value, typeof(T)) : (T)value; 25 | } 26 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/NativeHelpers.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Collections.Concurrent; 20 | 21 | namespace FirebirdSql.Data.Common; 22 | 23 | internal static class NativeHelpers 24 | { 25 | private static readonly ConcurrentDictionary _cache = new ConcurrentDictionary(StringComparer.Ordinal); 26 | 27 | public static void CallIfExists(string actionId, Action action) 28 | { 29 | if (!_cache.TryGetValue(actionId, out var executionAllowed)) 30 | { 31 | try 32 | { 33 | action(); 34 | _cache.TryAdd(actionId, true); 35 | } 36 | catch (EntryPointNotFoundException) 37 | { 38 | _cache.TryAdd(actionId, false); 39 | } 40 | } 41 | else if (executionAllowed) 42 | { 43 | action(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/ServiceParameterBufferBase.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Text; 20 | 21 | namespace FirebirdSql.Data.Common; 22 | 23 | internal abstract class ServiceParameterBufferBase : ParameterBuffer 24 | { 25 | public ServiceParameterBufferBase(Encoding encoding) 26 | { 27 | Encoding = encoding; 28 | } 29 | 30 | public abstract void AppendPreamble(); 31 | 32 | public abstract void Append1(int type, byte[] value); 33 | public abstract void Append2(int type, byte[] value); 34 | public abstract void Append(int type, byte value); 35 | public abstract void Append(int type, int value); 36 | 37 | public void Append1(int type, string value) => Append1(type, Encoding.GetBytes(value)); 38 | 39 | public void Append2(int type, string value) => Append2(type, Encoding.GetBytes(value)); 40 | 41 | public Encoding Encoding { get; } 42 | } 43 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/SizeHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal static class SizeHelper 23 | { 24 | public static bool IsValidPageSize(int value) 25 | { 26 | return value == 1024 27 | || value == 2048 28 | || value == 4096 29 | || value == 8192 30 | || value == 16384 31 | || value == 32768; 32 | } 33 | 34 | public static bool IsValidBatchBufferSize(int value) 35 | { 36 | return value >= 0 && value <= 256 * 1024 * 1024; 37 | } 38 | 39 | public static Exception InvalidSizeException(string what) 40 | { 41 | return new InvalidOperationException($"Invalid {what} size."); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/StatementState.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | [Serializable] 23 | internal enum StatementState 24 | { 25 | Deallocated, 26 | Allocated, 27 | Prepared, 28 | Executed, 29 | Closed, 30 | Error 31 | } 32 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/TransactionState.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal enum TransactionState 23 | { 24 | NoTransaction, 25 | Active, 26 | Prepared 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Common/ValueTask2.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Threading.Tasks; 19 | 20 | namespace FirebirdSql.Data.Common; 21 | 22 | internal static class ValueTask2 23 | { 24 | public static ValueTask FromResult(TResult result) => 25 | #if NET48 || NETSTANDARD2_0 || NETSTANDARD2_1 26 | new ValueTask(result); 27 | #else 28 | ValueTask.FromResult(result); 29 | #endif 30 | 31 | public static ValueTask CompletedTask => 32 | #if NET48 || NETSTANDARD2_0 || NETSTANDARD2_1 33 | default; 34 | #else 35 | ValueTask.CompletedTask; 36 | #endif 37 | } 38 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbDbType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.FirebirdClient; 21 | 22 | [Serializable] 23 | public enum FbDbType 24 | { 25 | Array, 26 | BigInt, 27 | Binary, 28 | Boolean, 29 | Char, 30 | Date, 31 | Decimal, 32 | Double, 33 | Float, 34 | Guid, 35 | Integer, 36 | Numeric, 37 | SmallInt, 38 | Text, 39 | Time, 40 | TimeStamp, 41 | VarChar, 42 | TimeStampTZ, 43 | TimeStampTZEx, 44 | TimeTZ, 45 | TimeTZEx, 46 | Dec16, 47 | Dec34, 48 | Int128, 49 | } 50 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbRemoteEventCountsEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.ComponentModel; 20 | 21 | namespace FirebirdSql.Data.FirebirdClient; 22 | 23 | public sealed class FbRemoteEventCountsEventArgs : EventArgs 24 | { 25 | public string Name { get; } 26 | public int Counts { get; } 27 | 28 | public FbRemoteEventCountsEventArgs(string name, int counts) 29 | { 30 | Name = name; 31 | Counts = counts; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbRemoteEventErrorEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.ComponentModel; 20 | 21 | namespace FirebirdSql.Data.FirebirdClient; 22 | 23 | public sealed class FbRemoteEventErrorEventArgs : EventArgs 24 | { 25 | public Exception Error { get; } 26 | 27 | public FbRemoteEventErrorEventArgs(Exception error) 28 | { 29 | Error = error; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbRowUpdatedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez 17 | 18 | using System; 19 | using System.Data; 20 | using System.Data.Common; 21 | 22 | namespace FirebirdSql.Data.FirebirdClient; 23 | 24 | public sealed class FbRowUpdatedEventArgs : RowUpdatedEventArgs 25 | { 26 | #region Properties 27 | 28 | public new FbCommand Command 29 | { 30 | get { return (FbCommand)base.Command; } 31 | } 32 | 33 | #endregion 34 | 35 | #region Constructors 36 | 37 | public FbRowUpdatedEventArgs( 38 | DataRow row, 39 | IDbCommand command, 40 | StatementType statementType, 41 | DataTableMapping tableMapping) 42 | : base(row, command, statementType, tableMapping) 43 | { 44 | } 45 | 46 | #endregion 47 | } 48 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbRowUpdatingEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez 17 | 18 | using System; 19 | using System.Data; 20 | using System.Data.Common; 21 | 22 | namespace FirebirdSql.Data.FirebirdClient; 23 | 24 | public sealed class FbRowUpdatingEventArgs : RowUpdatingEventArgs 25 | { 26 | #region Properties 27 | 28 | public new FbCommand Command 29 | { 30 | get { return (FbCommand)base.Command; } 31 | set { base.Command = value; } 32 | } 33 | 34 | #endregion 35 | 36 | #region Constructors 37 | 38 | public FbRowUpdatingEventArgs( 39 | DataRow row, 40 | IDbCommand command, 41 | StatementType statementType, 42 | DataTableMapping tableMapping) 43 | : base(row, command, statementType, tableMapping) 44 | { 45 | } 46 | 47 | #endregion 48 | } 49 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbServerType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.FirebirdClient; 21 | 22 | [Serializable] 23 | public enum FbServerType 24 | { 25 | Default = 0, 26 | Embedded = 1, 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbTransactionBehavior.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.FirebirdClient; 21 | 22 | [Serializable] 23 | [Flags] 24 | public enum FbTransactionBehavior 25 | { 26 | Consistency = 1 << 0, 27 | Concurrency = 1 << 1, 28 | Shared = 1 << 2, 29 | Protected = 1 << 3, 30 | Exclusive = 1 << 4, 31 | Wait = 1 << 5, 32 | NoWait = 1 << 6, 33 | Read = 1 << 7, 34 | Write = 1 << 8, 35 | LockRead = 1 << 9, 36 | LockWrite = 1 << 10, 37 | ReadCommitted = 1 << 11, 38 | Autocommit = 1 << 12, 39 | RecVersion = 1 << 13, 40 | NoRecVersion = 1 << 14, 41 | RestartRequests = 1 << 15, 42 | NoAutoUndo = 1 << 16, 43 | ReadConsistency = 1 << 17, 44 | } 45 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbWireCrypt.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.FirebirdClient; 21 | 22 | [Serializable] 23 | public enum FbWireCrypt 24 | { 25 | Disabled, 26 | Enabled, 27 | Required, 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/FirebirdClient/IFbPreparedCommand.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Threading; 19 | using System.Threading.Tasks; 20 | 21 | namespace FirebirdSql.Data.FirebirdClient; 22 | 23 | internal interface IFbPreparedCommand 24 | { 25 | void Release(); 26 | Task ReleaseAsync(CancellationToken cancellationToken = default); 27 | void TransactionCompleted(); 28 | Task TransactionCompletedAsync(CancellationToken cancellationToken = default); 29 | } 30 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Isql/CommandExecutedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Abel Eduardo Pereira, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.Data.FirebirdClient; 20 | 21 | namespace FirebirdSql.Data.Isql; 22 | 23 | public class CommandExecutedEventArgs : EventArgs 24 | { 25 | public FbDataReader DataReader { get; private set; } 26 | public string CommandText { get; private set; } 27 | public SqlStatementType StatementType { get; private set; } 28 | public int RowsAffected { get; private set; } 29 | 30 | public CommandExecutedEventArgs(FbDataReader dataReader, string commandText, SqlStatementType statementType, int rowsAffected) 31 | { 32 | DataReader = dataReader; 33 | CommandText = commandText; 34 | StatementType = statementType; 35 | RowsAffected = rowsAffected; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Isql/CommandExecutingEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Abel Eduardo Pereira, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.Data.FirebirdClient; 20 | 21 | namespace FirebirdSql.Data.Isql; 22 | 23 | public class CommandExecutingEventArgs : EventArgs 24 | { 25 | public FbCommand SqlCommand { get; private set; } 26 | public SqlStatementType StatementType { get; private set; } 27 | 28 | public CommandExecutingEventArgs(FbCommand sqlCommand, SqlStatementType statementType) 29 | { 30 | SqlCommand = sqlCommand; 31 | StatementType = statementType; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Isql/FbStatement.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Isql; 21 | 22 | [Serializable] 23 | public class FbStatement 24 | { 25 | public string Text { get; private set; } 26 | internal string CleanText { get; private set; } 27 | public SqlStatementType StatementType { get; private set; } 28 | 29 | internal FbStatement(string text, string cleanText) 30 | { 31 | Text = text; 32 | CleanText = cleanText; 33 | } 34 | 35 | internal void SetStatementType(SqlStatementType statementType) 36 | { 37 | StatementType = statementType; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Isql/FbStatementCollection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Collections.Generic; 20 | 21 | namespace FirebirdSql.Data.Isql; 22 | 23 | [Serializable] 24 | public class FbStatementCollection : List 25 | { 26 | internal FbStatementCollection() 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Isql/UnknownStatementEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Isql; 21 | 22 | public class UnknownStatementEventArgs : EventArgs 23 | { 24 | public FbStatement Statement { get; private set; } 25 | public bool Handled { get; set; } 26 | public bool Ignore { get; set; } 27 | public SqlStatementType NewStatementType { get; set; } 28 | 29 | public UnknownStatementEventArgs(FbStatement statement) 30 | { 31 | Statement = statement; 32 | Handled = false; 33 | Ignore = false; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Logging/FbLogLevel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.Data.Logging; 19 | 20 | public enum FbLogLevel 21 | { 22 | Trace = 1, 23 | Debug = 2, 24 | Info = 3, 25 | Warn = 4, 26 | Error = 5, 27 | Fatal = 6, 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Logging/IFbLoggingProvider.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.Data.Logging; 19 | 20 | public interface IFbLoggingProvider 21 | { 22 | IFbLogger CreateLogger(string name); 23 | } 24 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Logging/NullLoggingProvider.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Logging; 21 | 22 | sealed class NullLoggingProvider : IFbLoggingProvider 23 | { 24 | public IFbLogger CreateLogger(string name) => NullLogger.Instance; 25 | 26 | sealed class NullLogger : IFbLogger 27 | { 28 | internal static NullLogger Instance = new NullLogger(); 29 | 30 | NullLogger() { } 31 | 32 | public bool IsEnabled(FbLogLevel level) => false; 33 | 34 | public void Log(FbLogLevel level, string msg, Exception exception = null) { } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Properties/ComAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Runtime.InteropServices; 20 | 21 | [assembly: ComVisible(true)] 22 | [assembly: Guid("F37B8373-51FA-4CC6-934E-DF147DFBD9F1")] 23 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Properties/FirebirdSql.Data.FirebirdClient.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/NETProvider/ac0fc7987cd028a875e6399eefb8d4f7b3df0e13/src/FirebirdSql.Data.FirebirdClient/Properties/FirebirdSql.Data.FirebirdClient.snk -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbBackupFile.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Services; 21 | 22 | public class FbBackupFile 23 | { 24 | public string BackupFile { get; set; } 25 | public int? BackupLength { get; set; } 26 | 27 | public FbBackupFile(string fileName, int? fileLength = null) 28 | { 29 | BackupFile = fileName; 30 | BackupLength = fileLength; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbBackupFileCollection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Collections.Generic; 20 | 21 | namespace FirebirdSql.Data.Services; 22 | 23 | public class FbBackupFileCollection : List 24 | { } 25 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbBackupFlags.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | using FirebirdSql.Data.Common; 21 | 22 | namespace FirebirdSql.Data.Services; 23 | 24 | [Flags] 25 | public enum FbBackupFlags 26 | { 27 | IgnoreChecksums = IscCodes.isc_spb_bkp_ignore_checksums, 28 | IgnoreLimbo = IscCodes.isc_spb_bkp_ignore_limbo, 29 | MetaDataOnly = IscCodes.isc_spb_bkp_metadata_only, 30 | NoGarbageCollect = IscCodes.isc_spb_bkp_no_garbage_collect, 31 | OldDescriptions = IscCodes.isc_spb_bkp_old_descriptions, 32 | NonTransportable = IscCodes.isc_spb_bkp_non_transportable, 33 | Convert = IscCodes.isc_spb_bkp_convert, 34 | Expand = IscCodes.isc_spb_bkp_expand, 35 | NoDatabaseTriggers = IscCodes.isc_spb_bkp_no_triggers, 36 | Zip = IscCodes.isc_spb_bkp_zip, 37 | } 38 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbDatabaseTraceConfigurationCollection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | 22 | namespace FirebirdSql.Data.Services; 23 | 24 | public class FbDatabaseTraceConfigurationCollection : List 25 | { 26 | public string BuildConfiguration(FbTraceVersion version) 27 | { 28 | return string.Join(Environment.NewLine, this.Select(x => x.BuildConfiguration(version))); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbDatabasesInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Collections.Generic; 20 | 21 | namespace FirebirdSql.Data.Services; 22 | 23 | public class FbDatabasesInfo 24 | { 25 | public int ConnectionCount { get; internal set; } 26 | 27 | private List _databases; 28 | public IReadOnlyList Databases 29 | { 30 | get 31 | { 32 | return _databases.AsReadOnly(); 33 | } 34 | } 35 | 36 | internal FbDatabasesInfo() 37 | { 38 | _databases = new List(); 39 | } 40 | 41 | internal void AddDatabase(string database) 42 | { 43 | _databases.Add(database); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbNBackupFlags.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | using FirebirdSql.Data.Common; 21 | 22 | namespace FirebirdSql.Data.Services; 23 | 24 | [Flags] 25 | public enum FbNBackupFlags 26 | { 27 | NoDatabaseTriggers = IscCodes.isc_spb_nbk_no_triggers, 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbRestoreFlags.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | using FirebirdSql.Data.Common; 21 | 22 | namespace FirebirdSql.Data.Services; 23 | 24 | [Flags] 25 | public enum FbRestoreFlags 26 | { 27 | DeactivateIndexes = IscCodes.isc_spb_res_deactivate_idx, 28 | NoShadow = IscCodes.isc_spb_res_no_shadow, 29 | NoValidity = IscCodes.isc_spb_res_no_validity, 30 | IndividualCommit = IscCodes.isc_spb_res_one_at_a_time, 31 | Replace = IscCodes.isc_spb_res_replace, 32 | Create = IscCodes.isc_spb_res_create, 33 | UseAllSpace = IscCodes.isc_spb_res_use_all_space, 34 | MetaDataOnly = IscCodes.isc_spb_res_metadata_only, 35 | } 36 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbServiceState.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Services; 21 | 22 | public enum FbServiceState 23 | { 24 | Closed = 0, 25 | Open = 1 26 | } 27 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbServiceTraceEvents.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Services; 21 | 22 | [Flags] 23 | public enum FbServiceTraceEvents 24 | { 25 | Services = 0x01, 26 | ServiceQuery = 0x02, 27 | Errors = 0x04, 28 | Warnings = 0x08, 29 | InitFini = 0x10, 30 | } 31 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbShutdownMode.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Services; 21 | 22 | public enum FbShutdownMode 23 | { 24 | Forced, 25 | DenyTransaction, 26 | DenyConnection 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbShutdownOnlineMode.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Services; 21 | 22 | public enum FbShutdownOnlineMode 23 | { 24 | Normal, 25 | Multi, 26 | Single, 27 | Full, 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbShutdownType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Services; 21 | 22 | public enum FbShutdownType 23 | { 24 | ForceShutdown, 25 | AttachmentsShutdown, 26 | TransactionsShutdown, 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbTraceConfiguration.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Globalization; 19 | 20 | namespace FirebirdSql.Data.Services; 21 | 22 | public abstract class FbTraceConfiguration 23 | { 24 | protected static string WriteBoolValue(bool b) 25 | { 26 | return b ? "true" : "false"; 27 | } 28 | 29 | protected static string WriteString(string s) 30 | { 31 | s = s 32 | .Replace("{", "{{") 33 | .Replace("}", "}}") 34 | .Replace(@"\", @"\\") 35 | .Replace("\"", "\\\""); 36 | return string.Format("\"{0}\"", s); 37 | } 38 | 39 | protected static string WriteNumber(int i) 40 | { 41 | return i.ToString(CultureInfo.InvariantCulture); 42 | } 43 | 44 | protected static string WriteRegEx(string re) 45 | { 46 | return WriteString(re); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbTraceVersion.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.Data.Services; 19 | 20 | public enum FbTraceVersion 21 | { 22 | Detect, 23 | Version1, 24 | Version2, 25 | } 26 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/FbValidationFlags.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez 17 | 18 | using System; 19 | using FirebirdSql.Data.Common; 20 | 21 | namespace FirebirdSql.Data.Services; 22 | 23 | [Flags] 24 | public enum FbValidationFlags 25 | { 26 | ValidateDatabase = IscCodes.isc_spb_rpr_validate_db, 27 | SweepDatabase = IscCodes.isc_spb_rpr_sweep_db, 28 | MendDatabase = IscCodes.isc_spb_rpr_mend_db, 29 | CheckDatabase = IscCodes.isc_spb_rpr_check_db, 30 | IgnoreChecksum = IscCodes.isc_spb_rpr_ignore_checksum, 31 | KillShadows = IscCodes.isc_spb_rpr_kill_shadows, 32 | Full = IscCodes.isc_spb_rpr_full, 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.FirebirdClient/Services/ServiceOutputEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | 20 | namespace FirebirdSql.Data.Services; 21 | 22 | public sealed class ServiceOutputEventArgs : EventArgs 23 | { 24 | public string Message { get; } 25 | 26 | public ServiceOutputEventArgs(string message) 27 | { 28 | Message = message; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.TestsBase/FirebirdSql.Data.TestsBase.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 2f67ff6e-a6fc-44f4-9687-9e5ca05c73a3 7 | 8 | 9 | FirebirdSql.Data.TestsBase 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.TestsBase/FirebirdSql.Data.TestsBase.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2f67ff6e-a6fc-44f4-9687-9e5ca05c73a3 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.TestsBase/FirebirdSql.Data.TestsBase.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/NETProvider/ac0fc7987cd028a875e6399eefb8d4f7b3df0e13/src/FirebirdSql.Data.TestsBase/FirebirdSql.Data.TestsBase.snk -------------------------------------------------------------------------------- /src/FirebirdSql.Data.TestsBase/NoServerCategoryAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using NUnit.Framework; 19 | 20 | namespace FirebirdSql.Data.TestsBase; 21 | 22 | class NoServerCategoryAttribute : CategoryAttribute 23 | { 24 | public NoServerCategoryAttribute() 25 | : base("NoServer") 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.Data.TestsBase/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Linq; 19 | using System.Reflection; 20 | using NUnitLite; 21 | 22 | namespace FirebirdSql.Data.TestsBase; 23 | 24 | public static class Program 25 | { 26 | public static int Main(string[] args) 27 | { 28 | args = args?.Any() ?? false 29 | ? args 30 | : new[] { "--noresult", "--labels=All" }; 31 | return new AutoRun(Assembly.GetEntryAssembly()).Execute(args); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Helpers/Xunit.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Xunit; 19 | 20 | [assembly: CollectionBehavior(DisableTestParallelization = true)] 21 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/AdHocAdvancedMappingsQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class AdHocAdvancedMappingsQueryFbTest : AdHocAdvancedMappingsQueryRelationalTestBase 25 | { 26 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/AdHocComplexTypeQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class AdHocComplexTypeQueryFbTest : AdHocComplexTypeQueryTestBase 25 | { 26 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/AdHocManyToManyQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class AdHocManyToManyQueryFbTest : AdHocManyToManyQueryRelationalTestBase 25 | { 26 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/AdHocQueryFiltersQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Threading.Tasks; 19 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 20 | using Microsoft.EntityFrameworkCore.Query; 21 | using Microsoft.EntityFrameworkCore.TestUtilities; 22 | using Xunit; 23 | 24 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 25 | 26 | public class AdHocQueryFiltersQueryFbTest : AdHocQueryFiltersQueryRelationalTestBase 27 | { 28 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 29 | 30 | [Fact(Skip = "PK name collision and not easy way to override model.")] 31 | public override Task Self_reference_in_query_filter_works() 32 | { 33 | return base.Self_reference_in_query_filter_works(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/CompositeKeysQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 21 | 22 | public class CompositeKeysQueryFbTest : CompositeKeysQueryRelationalTestBase 23 | { 24 | public CompositeKeysQueryFbTest(CompositeKeysQueryFbFixture fixture) 25 | : base(fixture) 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/CompositeKeysSplitQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 21 | 22 | public class CompositeKeysSplitQueryFbTest : CompositeKeysSplitQueryRelationalTestBase 23 | { 24 | public CompositeKeysSplitQueryFbTest(CompositeKeysQueryFbFixture fixture) 25 | : base(fixture) 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/EntitySplittingQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class EntitySplittingQueryFbTest : EntitySplittingQueryTestBase 25 | { 26 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/GearsOfWarFromSqlQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 21 | 22 | public class GearsOfWarFromSqlQueryFbTest : GearsOfWarFromSqlQueryTestBase 23 | { 24 | public GearsOfWarFromSqlQueryFbTest(GearsOfWarQueryFbFixture fixture) 25 | : base(fixture) 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/GearsOfWarQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers; 19 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 20 | using Microsoft.EntityFrameworkCore; 21 | using Microsoft.EntityFrameworkCore.Query; 22 | using Microsoft.EntityFrameworkCore.TestUtilities; 23 | 24 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 25 | 26 | public class GearsOfWarQueryFbFixture : GearsOfWarQueryRelationalFixture 27 | { 28 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 29 | 30 | protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) 31 | { 32 | base.OnModelCreating(modelBuilder, context); 33 | ModelHelpers.SetStringLengths(modelBuilder); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/IncompleteMappingInheritanceQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class IncompleteMappingInheritanceQueryFbFixture : TPHInheritanceQueryFbFixture 25 | { 26 | public override bool IsDiscriminatorMappingComplete => false; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/IncompleteMappingInheritanceQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Xunit.Abstractions; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class IncompleteMappingInheritanceQueryFbTest : TPHInheritanceQueryTestBase 24 | { 25 | public IncompleteMappingInheritanceQueryFbTest(IncompleteMappingInheritanceQueryFbFixture fixture, ITestOutputHelper testOutputHelper) 26 | : base(fixture, testOutputHelper) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/ManyToManyQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers; 19 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 20 | using Microsoft.EntityFrameworkCore; 21 | using Microsoft.EntityFrameworkCore.Query; 22 | using Microsoft.EntityFrameworkCore.TestUtilities; 23 | 24 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 25 | 26 | public class ManyToManyQueryFbFixture : ManyToManyQueryRelationalFixture 27 | { 28 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 29 | 30 | protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) 31 | { 32 | base.OnModelCreating(modelBuilder, context); 33 | ModelHelpers.ShortenMM(modelBuilder); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/NorthwindAsNoTrackingQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Microsoft.EntityFrameworkCore.TestUtilities; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class NorthwindAsNoTrackingQueryFbTest : NorthwindAsNoTrackingQueryTestBase> 24 | { 25 | public NorthwindAsNoTrackingQueryFbTest(NorthwindQueryFbFixture fixture) 26 | : base(fixture) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/NorthwindAsTrackingQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Microsoft.EntityFrameworkCore.TestUtilities; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class NorthwindAsTrackingQueryFbTest : NorthwindAsTrackingQueryTestBase> 24 | { 25 | public NorthwindAsTrackingQueryFbTest(NorthwindQueryFbFixture fixture) 26 | : base(fixture) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/NorthwindNavigationsQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Microsoft.EntityFrameworkCore.TestUtilities; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class NorthwindNavigationsQueryFbTest : NorthwindNavigationsQueryRelationalTestBase> 24 | { 25 | public NorthwindNavigationsQueryFbTest(NorthwindQueryFbFixture fixture) 26 | : base(fixture) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/NorthwindQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestModels.Northwind; 20 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 21 | using Microsoft.EntityFrameworkCore.Infrastructure; 22 | using Microsoft.EntityFrameworkCore.Query; 23 | using Microsoft.EntityFrameworkCore.TestUtilities; 24 | 25 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 26 | 27 | public class NorthwindQueryFbFixture : NorthwindQueryRelationalFixture 28 | where TModelCustomizer : ITestModelCustomizer, new() 29 | { 30 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 31 | protected override Type ContextType => typeof(NorthwindFbContext); 32 | } 33 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/NorthwindQueryFiltersQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 21 | 22 | public class NorthwindQueryFiltersQueryFbTest : NorthwindQueryFiltersQueryTestBase> 23 | { 24 | public NorthwindQueryFiltersQueryFbTest(NorthwindQueryFbFixture fixture) 25 | : base(fixture) 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/NorthwindQueryTaggingQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Microsoft.EntityFrameworkCore.TestUtilities; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class NorthwindQueryTaggingQueryFbTest : NorthwindQueryTaggingQueryTestBase> 24 | { 25 | public NorthwindQueryTaggingQueryFbTest(NorthwindQueryFbFixture fixture) 26 | : base(fixture) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/NorthwindSqlQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Data.Common; 19 | using FirebirdSql.Data.FirebirdClient; 20 | using Microsoft.EntityFrameworkCore.Query; 21 | using Microsoft.EntityFrameworkCore.TestUtilities; 22 | 23 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 24 | 25 | public class NorthwindSqlQueryFbTest : NorthwindSqlQueryTestBase> 26 | { 27 | public NorthwindSqlQueryFbTest(NorthwindQueryFbFixture fixture) 28 | : base(fixture) 29 | { } 30 | 31 | protected override DbParameter CreateDbParameter(string name, object value) 32 | => new FbParameter { ParameterName = name, Value = value }; 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/NullKeysFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class NullKeysFbTest : NullKeysTestBase 25 | { 26 | public NullKeysFbTest(NullKeysFbFixture fixture) 27 | : base(fixture) 28 | { } 29 | 30 | public class NullKeysFbFixture : NullKeysFixtureBase 31 | { 32 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/NullSemanticsQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class NullSemanticsQueryFbFixture : NullSemanticsQueryFixtureBase 25 | { 26 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/OperatorsProceduralFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class OperatorsProceduralFbTest : OperatorsProceduralQueryTestBase 25 | { 26 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/OptionalDependentQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class OptionalDependentQueryFbFixture : OptionalDependentQueryFixtureBase 25 | { 26 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/QueryNoClientEvalFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Microsoft.EntityFrameworkCore.TestUtilities; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class QueryNoClientEvalFbTest : QueryNoClientEvalTestBase> 24 | { 25 | public QueryNoClientEvalFbTest(NorthwindQueryFbFixture fixture) 26 | : base(fixture) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/SharedTypeQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class SharedTypeQueryFbTest : SharedTypeQueryRelationalTestBase 25 | { 26 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCFiltersInheritanceQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 19 | 20 | public class TPCFiltersInheritanceQueryFbFixture : TPCInheritanceQueryFbFixture 21 | { 22 | public override bool EnableFilters => true; 23 | } 24 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCFiltersInheritanceQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Threading.Tasks; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class TPCFiltersInheritanceQueryFbTest : TPCFiltersInheritanceQueryTestBase 24 | { 25 | public TPCFiltersInheritanceQueryFbTest(TPCFiltersInheritanceQueryFbFixture fixture) 26 | : base(fixture) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCInheritanceQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 19 | 20 | public class TPCInheritanceQueryFbFixture : TPCInheritanceQueryFbFixtureBase 21 | { 22 | public override bool UseGeneratedKeys => true; 23 | } 24 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCInheritanceQueryFbFixtureBase.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public abstract class TPCInheritanceQueryFbFixtureBase : TPCInheritanceQueryFixture 25 | { 26 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCInheritanceQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Xunit.Abstractions; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 21 | 22 | public class TPCInheritanceQueryFbTest : TPCInheritanceQueryFbTestBase 23 | { 24 | public TPCInheritanceQueryFbTest(TPCInheritanceQueryFbFixture fixture, ITestOutputHelper testOutputHelper) 25 | : base(fixture, testOutputHelper) 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCInheritanceQueryFbTestBase.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Xunit.Abstractions; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public abstract class TPCInheritanceQueryFbTestBase : TPCInheritanceQueryTestBase 24 | where TFixture : TPCInheritanceQueryFbFixtureBase, new() 25 | { 26 | protected TPCInheritanceQueryFbTestBase(TFixture fixture, ITestOutputHelper testOutputHelper) 27 | : base(fixture, testOutputHelper) 28 | { } 29 | } 30 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCInheritanceQueryHiLoFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 21 | 22 | public class TPCInheritanceQueryHiLoFbFixture : TPCInheritanceQueryFbFixtureBase 23 | { 24 | protected override string StoreName => "TPCHiLoInheritanceTest"; 25 | 26 | protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) 27 | { 28 | modelBuilder.UseHiLo(); 29 | 30 | base.OnModelCreating(modelBuilder, context); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCInheritanceQueryHiLoFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Xunit.Abstractions; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 21 | 22 | public class TPCInheritanceQueryHiLoFbTest : TPCInheritanceQueryFbTestBase 23 | { 24 | public TPCInheritanceQueryHiLoFbTest(TPCInheritanceQueryHiLoFbFixture fixture, ITestOutputHelper testOutputHelper) 25 | : base(fixture, testOutputHelper) 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCManyToManyQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers; 19 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 20 | using Microsoft.EntityFrameworkCore; 21 | using Microsoft.EntityFrameworkCore.Query; 22 | using Microsoft.EntityFrameworkCore.TestUtilities; 23 | 24 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 25 | 26 | public class TPCManyToManyQueryFbFixture : TPCManyToManyQueryRelationalFixture 27 | { 28 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 29 | 30 | protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) 31 | { 32 | base.OnModelCreating(modelBuilder, context); 33 | ModelHelpers.ShortenMM(modelBuilder); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPCRelationshipsQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class TPCRelationshipsQueryFbTest : TPCRelationshipsQueryTestBase 25 | { 26 | public TPCRelationshipsQueryFbTest(TPCRelationshipsQueryFbFixture fixture) 27 | : base(fixture) 28 | { } 29 | 30 | public class TPCRelationshipsQueryFbFixture : TPCRelationshipsQueryRelationalFixture 31 | { 32 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPHFiltersInheritanceQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 19 | 20 | public class TPHFiltersInheritanceQueryFbFixture : TPHInheritanceQueryFbFixture 21 | { 22 | public override bool EnableFilters => true; 23 | } 24 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPHFiltersInheritanceQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 21 | 22 | public class TPHFiltersInheritanceQueryFbTest : FiltersInheritanceQueryTestBase 23 | { 24 | public TPHFiltersInheritanceQueryFbTest(TPHFiltersInheritanceQueryFbFixture fixture) 25 | : base(fixture) 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPHInheritanceQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Xunit.Abstractions; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class TPHInheritanceQueryFbTest : TPHInheritanceQueryTestBase 24 | { 25 | public TPHInheritanceQueryFbTest(TPHInheritanceQueryFbFixture fixture, ITestOutputHelper testOutputHelper) 26 | : base(fixture, testOutputHelper) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPTFiltersInheritanceQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore; 19 | using Microsoft.EntityFrameworkCore.TestModels.InheritanceModel; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class TPTFiltersInheritanceQueryFbFixture : TPTInheritanceQueryFbFixture 24 | { 25 | public override bool EnableFilters => true; 26 | 27 | protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) 28 | { 29 | base.OnModelCreating(modelBuilder, context); 30 | modelBuilder.Entity().Property(x => x.Id).UseSequenceTrigger(); 31 | modelBuilder.Entity().Property(x => x.Id).UseSequenceTrigger(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPTFiltersInheritanceQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 21 | 22 | public class TPTFiltersInheritanceQueryFbTest : TPTFiltersInheritanceQueryTestBase 23 | { 24 | public TPTFiltersInheritanceQueryFbTest(TPTFiltersInheritanceQueryFbFixture fixture) 25 | : base(fixture) 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPTGearsOfWarQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers; 19 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 20 | using Microsoft.EntityFrameworkCore; 21 | using Microsoft.EntityFrameworkCore.Query; 22 | using Microsoft.EntityFrameworkCore.TestUtilities; 23 | 24 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 25 | 26 | public class TPTGearsOfWarQueryFbFixture : TPTGearsOfWarQueryRelationalFixture 27 | { 28 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 29 | 30 | protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) 31 | { 32 | base.OnModelCreating(modelBuilder, context); 33 | ModelHelpers.SetStringLengths(modelBuilder); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPTInheritanceQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Xunit.Abstractions; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class TPTInheritanceQueryFbTest : TPTInheritanceQueryTestBase 24 | { 25 | public TPTInheritanceQueryFbTest(TPTInheritanceQueryFbFixture fixture, ITestOutputHelper testOutputHelper) 26 | : base(fixture, testOutputHelper) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPTManyToManyQueryFbFixture.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers; 19 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 20 | using Microsoft.EntityFrameworkCore; 21 | using Microsoft.EntityFrameworkCore.Query; 22 | using Microsoft.EntityFrameworkCore.TestUtilities; 23 | 24 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 25 | 26 | public class TPTManyToManyQueryFbFixture : TPTManyToManyQueryRelationalFixture 27 | { 28 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 29 | 30 | protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) 31 | { 32 | base.OnModelCreating(modelBuilder, context); 33 | ModelHelpers.ShortenMM(modelBuilder); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/TPTRelationshipsQueryFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | using Microsoft.EntityFrameworkCore.TestUtilities; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 23 | 24 | public class TPTRelationshipsQueryFbTest : TPTRelationshipsQueryTestBase 25 | { 26 | public TPTRelationshipsQueryFbTest(TPTRelationshipsQueryFbFixture fixture) 27 | : base(fixture) 28 | { } 29 | 30 | public class TPTRelationshipsQueryFbFixture : TPTRelationshipsQueryRelationalFixture 31 | { 32 | protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests/Query/WarningsFbTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Query; 19 | using Microsoft.EntityFrameworkCore.TestUtilities; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query; 22 | 23 | public class WarningsFbTest : WarningsTestBase> 24 | { 25 | public WarningsFbTest(NorthwindQueryFbFixture fixture) 26 | : base(fixture) 27 | { } 28 | } 29 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird.Tests/EntityFrameworkCoreTestsBase.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Threading.Tasks; 20 | using FirebirdSql.Data.FirebirdClient; 21 | using FirebirdSql.Data.TestsBase; 22 | 23 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Tests; 24 | 25 | public abstract class EntityFrameworkCoreTestsBase : FbTestsBase 26 | { 27 | public EntityFrameworkCoreTestsBase() 28 | : base(FbServerType.Default, false, FbWireCrypt.Enabled, false) 29 | { } 30 | 31 | public async Task GetDbContext() where TContext : FbTestDbContext 32 | { 33 | await Connection.CloseAsync(); 34 | return (TContext)Activator.CreateInstance(typeof(TContext), Connection.ConnectionString); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Diagnostics/Internal/FbLoggingDefinitions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Diagnostics; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Diagnostics.Internal; 21 | 22 | public class FbLoggingDefinitions : RelationalLoggingDefinitions 23 | { } 24 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Infrastructure/Internal/IFbOptions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Infrastructure; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Infrastructure.Internal; 21 | 22 | public interface IFbOptions : ISingletonOptions 23 | { 24 | bool ExplicitParameterTypes { get; } 25 | bool ExplicitStringLiteralTypes { get; } 26 | } 27 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Metadata/FbValueGenerationStrategy.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net), Jean Ressouche, Rafael Almeida (ralms@ralms.net) 17 | 18 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Metadata; 19 | 20 | public enum FbValueGenerationStrategy 21 | { 22 | None, 23 | SequenceTrigger, 24 | IdentityColumn, 25 | HiLo, 26 | } 27 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Metadata/Internal/FbAnnotationNames.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net), Jean Ressouche, Rafael Almeida (ralms@ralms.net) 17 | 18 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Metadata.Internal; 19 | 20 | public static class FbAnnotationNames 21 | { 22 | public const string Prefix = "Fb:"; 23 | public const string ValueGenerationStrategy = Prefix + nameof(ValueGenerationStrategy); 24 | public const string HiLoSequenceName = Prefix + nameof(HiLoSequenceName); 25 | public const string HiLoSequenceSchema = Prefix + nameof(HiLoSequenceSchema); 26 | public const string SequenceName = Prefix + nameof(SequenceName); 27 | public const string SequenceSchema = Prefix + nameof(SequenceSchema); 28 | public const string SequenceNameSuffix = Prefix+ nameof(SequenceNameSuffix); 29 | } 30 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Migrations/IFbMigrationSqlGeneratorBehavior.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Migrations; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird; 21 | 22 | public interface IFbMigrationSqlGeneratorBehavior 23 | { 24 | void CreateSequenceTriggerForColumn(string columnName, string tableName, string schemaName, MigrationsSqlGenerationOptions options, MigrationCommandListBuilder builder); 25 | void DropSequenceTriggerForColumn(string columnName, string tableName, string schemaName, MigrationsSqlGenerationOptions options, MigrationCommandListBuilder builder); 26 | } 27 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Properties/EntityFrameworkCoreAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net), Jean Ressouche, Rafael Almeida (ralms@ralms.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Design; 19 | 20 | [assembly: DesignTimeProviderServices("FirebirdSql.EntityFrameworkCore.Firebird.Design.Internal.FbDesignTimeServices")] 21 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Properties/FirebirdSql.EntityFrameworkCore.Firebird.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/NETProvider/ac0fc7987cd028a875e6399eefb8d4f7b3df0e13/src/FirebirdSql.EntityFrameworkCore.Firebird/Properties/FirebirdSql.EntityFrameworkCore.Firebird.snk -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQueryRootProcessor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Linq.Expressions; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Query.Internal; 22 | 23 | public class FbQueryRootProcessor : RelationalQueryRootProcessor 24 | { 25 | public FbQueryRootProcessor(QueryTranslationPreprocessorDependencies dependencies, RelationalQueryTranslationPreprocessorDependencies relationalDependencies, QueryCompilationContext queryCompilationContext) 26 | : base(dependencies, relationalDependencies, queryCompilationContext) 27 | { } 28 | 29 | protected override bool ShouldConvertToParameterQueryRoot(ParameterExpression constantExpression) 30 | { 31 | return false; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Query/Internal/FbQuerySqlGeneratorFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.EntityFrameworkCore.Firebird.Infrastructure.Internal; 19 | using Microsoft.EntityFrameworkCore.Query; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Query.Internal; 22 | 23 | public class FbQuerySqlGeneratorFactory : IQuerySqlGeneratorFactory 24 | { 25 | readonly QuerySqlGeneratorDependencies _dependencies; 26 | readonly IFbOptions _fbOptions; 27 | 28 | public FbQuerySqlGeneratorFactory(QuerySqlGeneratorDependencies dependencies, IFbOptions fbOptions) 29 | { 30 | _dependencies = dependencies; 31 | _fbOptions = fbOptions; 32 | } 33 | 34 | public QuerySqlGenerator Create() 35 | => new FbQuerySqlGenerator(_dependencies, _fbOptions); 36 | } 37 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbBoolTypeMapping.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Storage; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 21 | 22 | public class FbBoolTypeMapping : BoolTypeMapping 23 | { 24 | public FbBoolTypeMapping() 25 | : base("BOOLEAN", System.Data.DbType.Boolean) 26 | { } 27 | 28 | protected FbBoolTypeMapping(RelationalTypeMappingParameters parameters) 29 | : base(parameters) 30 | { } 31 | 32 | protected override string GenerateNonNullSqlLiteral(object value) 33 | { 34 | return (bool)value ? "TRUE" : "FALSE"; 35 | } 36 | 37 | protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters) 38 | => new FbBoolTypeMapping(parameters); 39 | } 40 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbByteArrayTypeMapping.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using FirebirdSql.Data.Common; 19 | using Microsoft.EntityFrameworkCore.Storage; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 22 | 23 | public class FbByteArrayTypeMapping : ByteArrayTypeMapping 24 | { 25 | public FbByteArrayTypeMapping() 26 | : base("BLOB SUB_TYPE BINARY", System.Data.DbType.Binary) 27 | { } 28 | 29 | protected FbByteArrayTypeMapping(RelationalTypeMappingParameters parameters) 30 | : base(parameters) 31 | { } 32 | 33 | protected override string GenerateNonNullSqlLiteral(object value) 34 | { 35 | var hex = ((byte[])value).ToHexString(); 36 | return $"x'{hex}'"; 37 | } 38 | 39 | protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters) 40 | => new FbByteArrayTypeMapping(parameters); 41 | } 42 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbDateOnlyTypeMapping.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Storage; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 21 | 22 | public class FbDateOnlyTypeMapping : DateOnlyTypeMapping 23 | { 24 | public FbDateOnlyTypeMapping(string storeType) 25 | : base(storeType) 26 | { } 27 | 28 | protected FbDateOnlyTypeMapping(RelationalTypeMappingParameters parameters) 29 | : base(parameters) 30 | { } 31 | 32 | protected override string GenerateNonNullSqlLiteral(object value) 33 | { 34 | return $"CAST('{value:yyyy-MM-dd}' AS DATE)"; 35 | } 36 | 37 | protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters) 38 | => new FbDateOnlyTypeMapping(parameters); 39 | } 40 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbRelationalConnection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Data.Common; 19 | using FirebirdSql.Data.FirebirdClient; 20 | using Microsoft.EntityFrameworkCore.Storage; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 23 | 24 | public class FbRelationalConnection : RelationalConnection, IFbRelationalConnection 25 | { 26 | public FbRelationalConnection(RelationalConnectionDependencies dependencies) 27 | : base(dependencies) 28 | { } 29 | 30 | protected override DbConnection CreateDbConnection() 31 | => new FbConnection(ConnectionString); 32 | } 33 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbRelationalTransaction.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Data.Common; 20 | using Microsoft.EntityFrameworkCore; 21 | using Microsoft.EntityFrameworkCore.Diagnostics; 22 | using Microsoft.EntityFrameworkCore.Storage; 23 | 24 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 25 | 26 | public class FbRelationalTransaction : RelationalTransaction, IFbRelationalTransaction 27 | { 28 | public FbRelationalTransaction(IRelationalConnection connection, DbTransaction transaction, Guid transactionId, IDiagnosticsLogger logger, bool transactionOwned, ISqlGenerationHelper sqlGenerationHelper) 29 | : base(connection, transaction, transactionId, logger, transactionOwned, sqlGenerationHelper) 30 | { } 31 | } 32 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbTimeOnlyTypeMapping.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Storage; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 21 | 22 | public class FbTimeOnlyTypeMapping : TimeOnlyTypeMapping 23 | { 24 | public FbTimeOnlyTypeMapping(string storeType) 25 | : base(storeType) 26 | { } 27 | 28 | protected FbTimeOnlyTypeMapping(RelationalTypeMappingParameters parameters) 29 | : base(parameters) 30 | { } 31 | 32 | protected override string GenerateNonNullSqlLiteral(object value) 33 | { 34 | return $"CAST('{value:HH\\:mm\\:ss.ffff}' AS TIME)"; 35 | } 36 | 37 | protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters) 38 | => new FbTimeOnlyTypeMapping(parameters); 39 | } 40 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IFbSqlGenerationHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Text; 19 | using Microsoft.EntityFrameworkCore.Storage; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 22 | 23 | public interface IFbSqlGenerationHelper : ISqlGenerationHelper 24 | { 25 | string StringLiteralQueryType(string s, bool isUnicode); 26 | string StringParameterQueryType(bool isUnicode); 27 | void GenerateBlockParameterName(StringBuilder builder, string name); 28 | string AlternativeStatementTerminator { get; } 29 | } 30 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IRelationalFbConnection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net), Jean Ressouche, Rafael Almeida (ralms@ralms.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Storage; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 21 | 22 | public interface IFbRelationalConnection : IRelationalConnection 23 | { } 24 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/IRelationalFbTransaction.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Storage; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 21 | 22 | public interface IFbRelationalTransaction 23 | { } 24 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Update/Internal/FbModificationCommandBatchFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Update; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Update.Internal; 21 | 22 | public class FbModificationCommandBatchFactory : IModificationCommandBatchFactory 23 | { 24 | readonly ModificationCommandBatchFactoryDependencies _dependencies; 25 | 26 | public FbModificationCommandBatchFactory(ModificationCommandBatchFactoryDependencies dependencies) 27 | { 28 | _dependencies = dependencies; 29 | } 30 | 31 | public ModificationCommandBatch Create() 32 | { 33 | return new SingularModificationCommandBatch(_dependencies); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Update/Internal/IFbUpdateSqlGenerator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Update; 19 | 20 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Update.Internal; 21 | 22 | public interface IFbUpdateSqlGenerator : IUpdateSqlGenerator 23 | { } 24 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/Utilities/TranslatorsHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using System.Collections.Generic; 20 | using System.Linq; 21 | using System.Reflection; 22 | 23 | namespace FirebirdSql.EntityFrameworkCore.Firebird.Utilities; 24 | 25 | public class TranslatorsHelper 26 | { 27 | public static IEnumerable GetTranslators() 28 | { 29 | return Assembly.GetExecutingAssembly().GetTypes() 30 | .Where(t => t.GetInterfaces().Any(i => i == typeof(TInterface))); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/ValueGeneration/Internal/FbSequenceValueGeneratorState.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Metadata; 19 | using Microsoft.EntityFrameworkCore.ValueGeneration; 20 | 21 | namespace FirebirdSql.EntityFrameworkCore.Firebird.ValueGeneration.Internal; 22 | 23 | public class FbSequenceValueGeneratorState : HiLoValueGeneratorState 24 | { 25 | public FbSequenceValueGeneratorState(ISequence sequence) 26 | : base(sequence.IncrementBy) 27 | { 28 | Sequence = sequence; 29 | } 30 | 31 | public virtual ISequence Sequence { get; } 32 | } 33 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/ValueGeneration/Internal/IFbSequenceValueGeneratorFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System; 19 | using FirebirdSql.EntityFrameworkCore.Firebird.Storage.Internal; 20 | using Microsoft.EntityFrameworkCore.Diagnostics; 21 | using Microsoft.EntityFrameworkCore.Metadata; 22 | using Microsoft.EntityFrameworkCore.Storage; 23 | using Microsoft.EntityFrameworkCore.ValueGeneration; 24 | 25 | namespace FirebirdSql.EntityFrameworkCore.Firebird.ValueGeneration.Internal; 26 | 27 | public interface IFbSequenceValueGeneratorFactory 28 | { 29 | ValueGenerator TryCreate(IProperty property, Type clrType, FbSequenceValueGeneratorState generatorState, IFbRelationalConnection connection, IRawSqlCommandBuilder rawSqlCommandBuilder, IRelationalCommandDiagnosticsLogger commandLogger); 30 | } 31 | -------------------------------------------------------------------------------- /src/FirebirdSql.EntityFrameworkCore.Firebird/ValueGeneration/Internal/IFbValueGeneratorCache.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using Microsoft.EntityFrameworkCore.Metadata; 19 | using Microsoft.EntityFrameworkCore.Storage; 20 | using Microsoft.EntityFrameworkCore.ValueGeneration; 21 | 22 | namespace FirebirdSql.EntityFrameworkCore.Firebird.ValueGeneration.Internal; 23 | 24 | public interface IFbValueGeneratorCache : IValueGeneratorCache 25 | { 26 | FbSequenceValueGeneratorState GetOrAddSequenceState(IProperty property, IRelationalConnection connection); 27 | } 28 | -------------------------------------------------------------------------------- /src/Perf/Perf.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Exe 4 | net9.0 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | CommandBenchmark.cs 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Perf/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | using System.Reflection; 19 | using BenchmarkDotNet.Running; 20 | 21 | namespace Perf; 22 | 23 | class Program 24 | { 25 | static void Main(string[] args) 26 | { 27 | BenchmarkRunner.Run(Assembly.GetExecutingAssembly()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Scratchpad/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the Initial 3 | * Developer's Public License Version 1.0 (the "License"); 4 | * you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. 7 | * 8 | * Software distributed under the License is distributed on 9 | * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 10 | * express or implied. See the License for the specific 11 | * language governing rights and limitations under the License. 12 | * 13 | * All Rights Reserved. 14 | */ 15 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) 17 | 18 | namespace Scratchpad; 19 | 20 | class Program 21 | { 22 | static void Main(string[] args) 23 | { 24 | // Scratchpad 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Scratchpad/Scratchpad.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Exe 4 | net9.0 5 | true 6 | true 7 | ..\FirebirdSql.Data.TestsBase\FirebirdSql.Data.TestsBase.snk 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Versions.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10.3.3 5 | 6 | 7 | 8 | 12.0.0 9 | 10.3.2 10 | 9.0.1 11 | 12 | 13 | 14 | 10.1.0 15 | 10.3.2 16 | 6.5.1 17 | 18 | 19 | --------------------------------------------------------------------------------