├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .snyk ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── Neo4j.Driver ├── .editorconfig ├── IdentityPubKey.snk ├── Neo4j-icon-color.png ├── Neo4j.Driver.Reactive │ ├── DriverExtensions.cs │ ├── IRxResult.cs │ ├── IRxRunnable.cs │ ├── IRxSession.cs │ ├── IRxTransaction.cs │ ├── Internal │ │ ├── InternalRxSession.cs │ │ ├── InternalRxTransaction.cs │ │ ├── RxExtensions.cs │ │ ├── RxResult.cs │ │ └── RxRetryLogic.cs │ ├── Neo4j.Driver.Reactive.csproj │ └── Properties │ │ └── AssemblyInfo.cs ├── Neo4j.Driver.Simple │ ├── DriverExtensions.cs │ ├── IQueryRunner.cs │ ├── IResult.cs │ ├── ISession.cs │ ├── ITransaction.cs │ ├── Internal │ │ ├── BlockingExecutor.cs │ │ ├── InternalResult.cs │ │ ├── InternalSession.cs │ │ ├── InternalTransaction.cs │ │ ├── RecordSet.cs │ │ └── RetryLogic.cs │ ├── Neo4j.Driver.Simple.csproj │ └── Properties │ │ └── AssemblyInfo.cs ├── Neo4j.Driver.Tests.BenchkitBackend │ ├── Abstractions │ │ ├── IRecordConsumer.cs │ │ ├── IWorkloadExecutor.cs │ │ ├── IWorkloadExecutorSelector.cs │ │ ├── IWorkloadSessionBuilder.cs │ │ └── IWorkloadStore.cs │ ├── BenchkitBackendModule.cs │ ├── Configuration │ │ └── BenchkitBackendConfiguration.cs │ ├── Controllers │ │ ├── ReadyController.cs │ │ └── WorkloadController.cs │ ├── Dockerfile │ ├── Implementations │ │ ├── ExecuteQueryWorkloadExecutor.cs │ │ ├── ExecuteReadWriteWorkloadExecutor.cs │ │ ├── RecordConsumer.cs │ │ ├── SessionRunWorkloadExecutor.cs │ │ ├── WorkloadExecutorSelector.cs │ │ ├── WorkloadSessionBuilder.cs │ │ └── WorkloadStore.cs │ ├── InfrastructureExtensions │ │ ├── JsonConverters │ │ │ └── ObjectToPrimitiveConverter.cs │ │ ├── LogEnrichers │ │ │ └── ClassNameEnricher.cs │ │ └── WebExtensions │ │ │ ├── ConfigurationBuilderExtensions.cs │ │ │ └── Neo4jDriverServiceExtension.cs │ ├── LogoWriter.cs │ ├── Neo4j.Driver.Tests.BenchkitBackend.csproj │ ├── Neo4j.Driver.Tests.BenchkitBackend.csproj.DotSettings │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Types │ │ ├── Method.cs │ │ ├── Mode.cs │ │ ├── Routing.cs │ │ ├── Workload.cs │ │ └── WorkloadQuery.cs │ └── appsettings.json ├── Neo4j.Driver.Tests.Integration │ ├── App.config │ ├── Direct │ │ ├── AuthenticationIT.cs │ │ ├── BoltV4IT.cs │ │ ├── BookmarkIT.cs │ │ ├── CertificateTrustIT.cs │ │ ├── CypherParametersIT.cs │ │ ├── DirectDriverTestBase.cs │ │ ├── DriverIT.cs │ │ ├── EncryptionIT.cs │ │ ├── ErrorIT.cs │ │ ├── NestedQueriesIT.cs │ │ ├── ResultIT.cs │ │ ├── SessionIT.cs │ │ └── TransactionIT.cs │ ├── Examples.cs │ ├── ExamplesAsync.cs │ ├── ExamplesRx.cs │ ├── Extensions │ │ ├── CollectionExtensions.cs │ │ ├── DatabaseExtensions.cs │ │ └── SessionExtensions.cs │ ├── Internals │ │ ├── BoltStubServer.cs │ │ ├── BoltkitHelper.cs │ │ ├── CausalClusterIntegrationTestFixture.cs │ │ ├── CcIntegrationCollection.cs │ │ ├── CertificateUtils.cs │ │ ├── Cluster │ │ │ ├── CausalCluster.cs │ │ │ ├── ExistingCluster.cs │ │ │ ├── ExternalBoltkitClusterInstaller.cs │ │ │ ├── ICausalCluster.cs │ │ │ └── SingleInstance.cs │ │ ├── IInstaller.cs │ │ ├── IShellCommandRunner.cs │ │ ├── ISingleInstance.cs │ │ ├── IntegrationTestAttribute.cs │ │ ├── IntegrationTestFixture.cs │ │ ├── ProcessBasedCommandRunner.cs │ │ ├── SaIntegrationCollection.cs │ │ ├── ShellCommandRunnerTests.cs │ │ └── StandAlone │ │ │ ├── DefaultInstallation.cs │ │ │ ├── ExternalBoltkitInstaller.cs │ │ │ ├── LocalStandAloneInstance.cs │ │ │ ├── SettingsHelper.cs │ │ │ └── StandAlone.cs │ ├── Neo4j.Driver.Tests.Integration.csproj │ ├── Neo4j.Driver.Tests.Integration.csproj.DotSettings │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Reactive │ │ ├── AbstractRxIT.cs │ │ ├── NavigationIT.cs │ │ ├── NestedQueriesIT.cs │ │ ├── SessionIT.cs │ │ ├── SummaryIT.cs │ │ └── TransactionIT.cs │ ├── Resources │ │ ├── V3 │ │ │ ├── connection_error_on_commit.script │ │ │ ├── fail_to_auth.script │ │ │ ├── get_routing_table.script │ │ │ ├── get_routing_table_with_context.script │ │ │ ├── rollback_error.script │ │ │ ├── supports_multidb.script │ │ │ └── verify_connectivity.script │ │ ├── V4 │ │ │ ├── accessmode_reader_explicit.script │ │ │ ├── accessmode_reader_func.script │ │ │ ├── accessmode_reader_implicit.script │ │ │ ├── accessmode_router.script │ │ │ ├── accessmode_writer_explicit.script │ │ │ ├── accessmode_writer_func.script │ │ │ ├── accessmode_writer_implicit.script │ │ │ ├── acquire_endpoints_aDatabase.script │ │ │ ├── acquire_endpoints_aDatabase_no_servers.script │ │ │ ├── acquire_endpoints_aDatabase_with_bookmark.script │ │ │ ├── acquire_endpoints_db_not_found.script │ │ │ ├── acquire_endpoints_default_database.script │ │ │ ├── connection_error_on_commit.script │ │ │ ├── discard_streaming_records.script │ │ │ ├── discard_streaming_records_tx.script │ │ │ ├── fail_to_auth.script │ │ │ ├── get_routing_table.script │ │ │ ├── get_routing_table_only.script │ │ │ ├── get_routing_table_with_context.script │ │ │ ├── multiple_bookmarks.script │ │ │ ├── read.script │ │ │ ├── read_from_aDatabase.script │ │ │ ├── read_from_aDatabase_with_bookmark.script │ │ │ ├── return_1.script │ │ │ ├── rollback_error.script │ │ │ ├── streaming_records.script │ │ │ ├── streaming_records_all.script │ │ │ ├── supports_multidb.script │ │ │ ├── verify_connectivity.script │ │ │ └── write_to_aDatabase.script │ │ └── V4_1 │ │ │ └── noop.script │ ├── Routing │ │ ├── BoltV4IT.cs │ │ ├── RoutingDriverAsyncIT.cs │ │ ├── RoutingDriverIT.cs │ │ └── RoutingDriverTestBase.cs │ ├── Stress │ │ ├── Async │ │ │ ├── AsyncFailingCommandTxFunc.cs │ │ │ ├── AsyncReadCommandTxFunc.cs │ │ │ ├── AsyncWriteCommandTxFunc.cs │ │ │ ├── AsyncWriteCommandUsingReadSessionTxFunc.cs │ │ │ └── AsyncWrongCommandTxFunc.cs │ │ ├── AsyncCommand.cs │ │ ├── Blocking │ │ │ ├── BlockingFailingCommandTxFunc.cs │ │ │ ├── BlockingReadCommandTxFunc.cs │ │ │ ├── BlockingWriteCommandTxFunc.cs │ │ │ ├── BlockingWriteCommandUsingReadSessionTxFunc.cs │ │ │ └── BlockingWrongCommandTxFunc.cs │ │ ├── BlockingCommand.cs │ │ ├── CausalClusterStressTests.cs │ │ ├── IAsyncCommand.cs │ │ ├── IBlockingCommand.cs │ │ ├── IRxCommand.cs │ │ ├── Reactive │ │ │ ├── RxFailingCommandInTx.cs │ │ │ ├── RxReadCommandInTx.cs │ │ │ ├── RxWriteCommandInTx.cs │ │ │ └── RxWrongCommandInTx.cs │ │ ├── RxCommand.cs │ │ ├── SingleInstanceStressTests.cs │ │ ├── StressTest.cs │ │ └── StressTestContext.cs │ ├── Stub │ │ ├── AccessModeTests.cs │ │ ├── DirectDriverTests.cs │ │ ├── MultiDatabasesTests.cs │ │ ├── ResultStreamingTests.cs │ │ ├── RoutingDriverTests.cs │ │ └── TransactionTests.cs │ ├── Types │ │ ├── PointsIT.cs │ │ └── TemporalTypesIT.cs │ ├── packages.config │ └── xunit.runner.json ├── Neo4j.Driver.Tests.TestBackend │ ├── .editorconfig │ ├── Controller.cs │ ├── Exceptions │ │ ├── DriverExceptionWrapper.cs │ │ ├── ExceptionManager.cs │ │ └── FrontendException.cs │ ├── IO │ │ ├── Connection.cs │ │ ├── RequestReader.cs │ │ ├── ResponseWriter.cs │ │ └── StreamBuffer.cs │ ├── Neo4j.Driver.Tests.TestBackend.csproj │ ├── Program.cs │ ├── Program.runtimeconfig.json │ ├── Properties │ │ └── launchSettings.json │ ├── Protocol │ │ ├── Auth │ │ │ ├── AuthTokenManagerClose.cs │ │ │ ├── AuthTokenManagerGetAuthCompleted.cs │ │ │ ├── AuthTokenManagerHandleSecurityExceptionCompleted.cs │ │ │ ├── AuthorizationToken.cs │ │ │ ├── BasicAuthTokenProviderCompleted.cs │ │ │ ├── BearerAuthTokenProviderCompleted.cs │ │ │ ├── CheckSessionAuthSupport.cs │ │ │ ├── ClientCertificate.cs │ │ │ ├── ClientCertificateProviderClose.cs │ │ │ ├── ClientCertificateProviderCompleted.cs │ │ │ ├── NewAuthTokenManager.cs │ │ │ ├── NewBasicAuthTokenManager.cs │ │ │ ├── NewBearerAuthTokenManager.cs │ │ │ ├── NewClientCertificateProvider.cs │ │ │ ├── TemporalAuthTokenProviderCompleted.cs │ │ │ └── VerifyAuthentication.cs │ │ ├── BookmarkManager │ │ │ ├── BookmarkManagerClose.cs │ │ │ ├── BookmarkManagerConsumerRequest.cs │ │ │ ├── BookmarkManagerSupplierRequest.cs │ │ │ ├── BookmarksConsumerCompleted.cs │ │ │ ├── BookmarksSupplierCompleted.cs │ │ │ └── NewBookmarkManager.cs │ │ ├── Driver │ │ │ ├── DriverClose.cs │ │ │ ├── GetConnectionPoolMetrics.cs │ │ │ ├── NewDriver.cs │ │ │ ├── NewDriverConverter.cs │ │ │ └── SimpleLogger.cs │ │ ├── DriverQuery │ │ │ └── ExecuteQuery.cs │ │ ├── Handshake │ │ │ ├── GetFeatures.cs │ │ │ └── StartTest.cs │ │ ├── JsonConverters │ │ │ ├── BaseSessionTypeJsonConverter.cs │ │ │ ├── QueryParameterConverter.cs │ │ │ └── SessionTypeJsonConverter.cs │ │ ├── Protocol.cs │ │ ├── ProtocolException.cs │ │ ├── ProtocolObjectFactory.cs │ │ ├── ProtocolObjectManager.cs │ │ ├── ProtocolResponse.cs │ │ ├── Result │ │ │ ├── CypherTypeField.cs │ │ │ ├── Result.cs │ │ │ ├── ResultConsume.cs │ │ │ ├── ResultList.cs │ │ │ ├── ResultNext.cs │ │ │ ├── ResultPeek.cs │ │ │ ├── ResultSingle.cs │ │ │ └── SummaryJsonSerializer.cs │ │ ├── Session │ │ │ ├── BaseSessionType.cs │ │ │ ├── JsonCypherParameterParser.cs │ │ │ ├── NewSession.cs │ │ │ ├── RetryableNegative.cs │ │ │ ├── RetryablePositive.cs │ │ │ ├── SessionBeginTransaction.cs │ │ │ ├── SessionClose.cs │ │ │ ├── SessionLastBookmarks.cs │ │ │ ├── SessionReadTransaction.cs │ │ │ ├── SessionRun.cs │ │ │ └── SessionWriteTransaction.cs │ │ ├── SupportFunctions │ │ │ ├── CheckDriverIsEncrypted.cs │ │ │ ├── CheckMultiDBSupport.cs │ │ │ ├── GetRoutingTable.cs │ │ │ ├── GetServerInfo.cs │ │ │ ├── ResolverResolutionCompleted.cs │ │ │ └── VerifyConnectivity.cs │ │ ├── TestkitConstants.cs │ │ ├── Time │ │ │ └── FakeTime.cs │ │ ├── Transaction │ │ │ ├── TransactionClose.cs │ │ │ ├── TransactionCommit.cs │ │ │ ├── TransactionRollback.cs │ │ │ └── TransactionRun.cs │ │ └── UI │ │ │ └── ConsoleTextWriter.cs │ ├── Resolvers │ │ └── ListAddressResolver.cs │ ├── SupportedFeatures.cs │ ├── TestBlackList.cs │ ├── Transaction │ │ └── TransactionManager.cs │ └── Types │ │ ├── CypherToNative.cs │ │ └── NativeToCypher.cs ├── Neo4j.Driver.Tests │ ├── .editorconfig │ ├── AsyncRetryLogicTests.cs │ ├── AsyncSessionTests.cs │ ├── Auth │ │ └── Neo4jAuthTokenManagerTests.cs │ ├── AuthTokenTests.cs │ ├── BookmarkTests.cs │ ├── ConfigTests.cs │ ├── ConnectionPoolTests.cs │ ├── ConnectionValidatorTests.cs │ ├── Connector │ │ ├── BoltHandshakerTests.cs │ │ ├── CachingResolverTests.cs │ │ ├── DefaultResolverTests.cs │ │ ├── DelegatedConnectionTests.cs │ │ ├── EncryptionManagerTests.cs │ │ ├── MockedMessagingClient.cs │ │ ├── PooledConnectionTests.cs │ │ ├── SocketClientTests.cs │ │ ├── SocketConnectionTests.cs │ │ └── TcpSocketClientTests.cs │ ├── DriverTests.cs │ ├── Exceptions │ │ └── Neo4jExceptionFactoryTests.cs │ ├── ExecutableQuery │ │ └── ExecutableQueryTests.cs │ ├── Extensions │ │ └── StreamExtensionTests.cs │ ├── Filters │ │ ├── OSFilters.cs │ │ └── RuntimeFilters.cs │ ├── GqlCompliance │ │ └── GqlErrorTests.cs │ ├── HomeDbCaching │ │ └── HomeDbCacheTests.cs │ ├── Internal │ │ ├── BookmarkManager │ │ │ ├── BookmarkManagerFactoryTests.cs │ │ │ └── DefaultBookmarkManagerTests.cs │ │ ├── IO │ │ │ ├── ChunkReaderTests.cs │ │ │ ├── ChunkWriterTests.cs │ │ │ ├── MessageSerializers │ │ │ │ ├── BeginMessageSerializerTests.cs │ │ │ │ ├── CommitMessageSerializerTests.cs │ │ │ │ ├── DiscardMessageSerializerTests.cs │ │ │ │ ├── FailureMessageSerializerTests.cs │ │ │ │ ├── GoodbyeMessageSerializerTests.cs │ │ │ │ ├── HelloMessageSerializerTests.cs │ │ │ │ ├── IgnoredMessageSerializerTests.cs │ │ │ │ ├── PullAllMessageSerializerTests.cs │ │ │ │ ├── PullMessageSerializerTests.cs │ │ │ │ ├── RecordMessageSerializerTests.cs │ │ │ │ ├── ResetMessageSerializerTests.cs │ │ │ │ ├── RollbackMessageSerializerTests.cs │ │ │ │ ├── RouteMessageSerializerTests.cs │ │ │ │ ├── RouteMessageSerializerV43Tests.cs │ │ │ │ ├── RunWithMetadataMessageSerializerTests.cs │ │ │ │ └── SuccessMessageSerializerTests.cs │ │ │ ├── PackStreamSerializerTests.cs │ │ │ ├── PackStreamTestSpecs.cs │ │ │ ├── PackStreamTests.cs │ │ │ ├── Utils │ │ │ │ ├── Machines.cs │ │ │ │ └── Streams.cs │ │ │ └── ValueSerializers │ │ │ │ ├── ElementNodeSerializerTests.cs │ │ │ │ ├── ElementPathSerializerTests.cs │ │ │ │ ├── ElementRelationshipSerializerTests.cs │ │ │ │ ├── ElementUnboundRelationshipSerializerTests.cs │ │ │ │ ├── NodeSerializerTests.cs │ │ │ │ ├── PathSerializerTests.cs │ │ │ │ ├── PointSerializerTests.cs │ │ │ │ ├── RelationshipSerializerTests.cs │ │ │ │ ├── Temporal │ │ │ │ ├── DurationSerializerTests.cs │ │ │ │ ├── LocalDateSerializerTests.cs │ │ │ │ ├── LocalDateTimeSerializerTests.cs │ │ │ │ ├── LocalTimeSerializerTests.cs │ │ │ │ ├── OffsetTimeSerializerTests.cs │ │ │ │ ├── SystemDateTimeOffsetHandlerTests.cs │ │ │ │ ├── SystemDateTimeSerializerTests.cs │ │ │ │ ├── SystemTimeSpanSerializerTests.cs │ │ │ │ ├── UtcZonedDateTimeSerializerTests.cs │ │ │ │ └── ZonedDateTimeSerializerTests.cs │ │ │ │ └── UnboundRelationshipSerializerTests.cs │ │ ├── MessageHandling │ │ │ ├── InMemoryPipelinedMessageReaderTests.cs │ │ │ ├── MessageFomatTests.cs │ │ │ ├── Messages │ │ │ │ ├── BeginMessageTests.cs │ │ │ │ ├── BoltAgentBuilderTests.cs │ │ │ │ ├── CommitMessageTests.cs │ │ │ │ ├── DiscardMessageTests.cs │ │ │ │ ├── FailureMessageTests.cs │ │ │ │ ├── GoodbyeMessageTests.cs │ │ │ │ ├── HelloMessageTests.cs │ │ │ │ ├── IgnoredMessageTests.cs │ │ │ │ ├── PullAllMessageTests.cs │ │ │ │ ├── PullMessageTests.cs │ │ │ │ ├── RecordMessageTests.cs │ │ │ │ ├── ResetMessageTests.cs │ │ │ │ ├── RollbackMessageTests.cs │ │ │ │ ├── RouteMessageTests.cs │ │ │ │ ├── RouteMessageV43Tests.cs │ │ │ │ ├── RunWithMetaDataMessageTests.cs │ │ │ │ └── SuccessMessageTests.cs │ │ │ ├── Metadata │ │ │ │ ├── BookmarkCollectorTests.cs │ │ │ │ ├── ConfigurationHintsCollectorTests.cs │ │ │ │ ├── ConnectionIdCollectorTests.cs │ │ │ │ ├── CountersCollectorTests.cs │ │ │ │ ├── DatabaseInfoCollectorTests.cs │ │ │ │ ├── DurationCollectorsTests.cs │ │ │ │ ├── FieldsCollectorTests.cs │ │ │ │ ├── GqlStatusObjectsAndNotificationsCollectorTests.cs │ │ │ │ ├── GqlStatusObjectsAndNotificationsTests.cs │ │ │ │ ├── HasMoreCollectorTests.cs │ │ │ │ ├── PlanCollectorTests.cs │ │ │ │ ├── ProfiledPlanCollectorTests.cs │ │ │ │ ├── QueryIdCollectorTests.cs │ │ │ │ ├── RoutingTableCollectorTest.cs │ │ │ │ ├── ServerVersionCollectorTests.cs │ │ │ │ └── TypeCollectorTests.cs │ │ │ ├── MetadataCollectingResponseHandlerTests.cs │ │ │ ├── NetworkedPipelinedMessageReaderTests.cs │ │ │ └── ResponsePipelineTests.cs │ │ ├── Protocol │ │ │ ├── BoltProtocolFactoryTests.cs │ │ │ ├── BoltProtocolHandlerFactoryTests.cs │ │ │ ├── BoltProtocolTests.cs │ │ │ ├── BoltProtocolV3Tests.cs │ │ │ └── BoltProtocolVersionTests.cs │ │ └── Util │ │ │ ├── ConcurrentOrderedSetTests.cs │ │ │ ├── ConfigBuildersTests.cs │ │ │ ├── PipeReaderMemoryPoolTests.cs │ │ │ ├── TransactionTimeoutTests.cs │ │ │ └── VarLongTests.cs │ ├── Mapping │ │ ├── AsyncEnumerableExtensionsTests.cs │ │ ├── BlueprintMappingTests.cs │ │ ├── BuiltMapperTests.cs │ │ ├── ConventionTranslation │ │ │ ├── FormatterTests.cs │ │ │ ├── ParserTests.cs │ │ │ ├── TranslationEndToEndTests.cs │ │ │ └── TranslatorTests.cs │ │ ├── DefaultMapperTests.cs │ │ ├── DelegateExecutableQueryMappingExtensionsTests.cs │ │ ├── DelegateMapperTests.cs │ │ ├── DictAsRecordTests.cs │ │ ├── LabelCaptureTests.cs │ │ ├── LambdaMappingRecordExtensionsTests.cs │ │ ├── MappableValueProviderTests.cs │ │ ├── MappedListCreatorTests.cs │ │ ├── MappingBuilderTests.cs │ │ ├── MappingConcurrencyTests.cs │ │ ├── MappingProviderTests.cs │ │ ├── MappingSourceDelegateBuilderTests.cs │ │ ├── MappingTestWithGlobalState.cs │ │ ├── OptionalMappingTests.cs │ │ ├── RecordMappingTests.cs │ │ ├── RecordPathFinderTests.cs │ │ └── TypeConversion │ │ │ ├── TypeConversionManagerTests.cs │ │ │ └── TypeConversionTests.cs │ ├── Neo4j.Driver.Tests.csproj │ ├── Neo4j.Driver.Tests.csproj.DotSettings │ ├── NodeTests.cs │ ├── PathTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Reactive │ │ ├── AbstractRxTest.cs │ │ ├── DriverExtensionTests.cs │ │ ├── Internal │ │ │ ├── InternalRxResultTests.cs │ │ │ ├── InternalRxSessionTests.cs │ │ │ ├── InternalRxTransactionTests.cs │ │ │ └── RxRetryLogicTests.cs │ │ └── Utils │ │ │ ├── Extensions.cs │ │ │ └── Utils.cs │ ├── RelationshipTests.cs │ ├── Result │ │ ├── RecordSetTests.cs │ │ ├── RecordTests.cs │ │ ├── ResultCursorBuilderTests.cs │ │ ├── ResultCursorTests.cs │ │ ├── ResultTests.cs │ │ └── SummaryBuilderTests.cs │ ├── ResultCursorExtensionsTests.cs │ ├── Routing │ │ ├── ClusterConnectionPoolTests.cs │ │ ├── ClusterConnectionTests.cs │ │ ├── ClusterDiscoveryTests.cs │ │ ├── LeastConnectedLoadBalancingStrategyTests.cs │ │ ├── LoadBalancerTests.cs │ │ ├── RoundRobinArrayIndexTests.cs │ │ ├── RoutingTableManagerTests.cs │ │ ├── RoutingTableTests.cs │ │ └── ServerVersionTests.cs │ ├── SessionConfigBuilderTests.cs │ ├── SessionConfigTests.cs │ ├── Simple │ │ └── Internal │ │ │ ├── InternalSessionTests.cs │ │ │ └── InternalTransactionTests.cs │ ├── Synchronous │ │ └── Internal │ │ │ └── SyncRetryLogicTests.cs │ ├── Temporal │ │ └── TimeZoneMappingTests.cs │ ├── TestDriverContext.cs │ ├── TestUtil │ │ ├── Assertions.cs │ │ ├── CollectionExtensionsTests.cs │ │ ├── LoggingHelper.cs │ │ ├── MockExtensions.cs │ │ ├── MockExtensionsTests.cs │ │ ├── Neo4jUriTests.cs │ │ ├── SocketClientTestHarness.cs │ │ ├── TestDriverLogger.cs │ │ └── TestRecord.cs │ ├── TransactionConfigTests.cs │ ├── TransactionTests.cs │ ├── Types │ │ ├── DurationTests.cs │ │ ├── LocalDateTests.cs │ │ ├── LocalDateTimeTests.cs │ │ ├── LocalTimeTests.cs │ │ ├── NotificationTests.cs │ │ ├── OffsetTimeTests.cs │ │ ├── PointTests.cs │ │ ├── ZonedDateTimeWithOffsetTests.cs │ │ └── ZonedDateTimeWithZoneIdTests.cs │ ├── ValueExtensionsTests.cs │ └── app.config ├── Neo4j.Driver.sln ├── Neo4j.Driver.sln.DotSettings ├── Neo4j.Driver │ ├── Internal │ │ ├── AcquireStatus.cs │ │ ├── AsyncQueryRunner.cs │ │ ├── AsyncRetryLogic.cs │ │ ├── AsyncSession.cs │ │ ├── AsyncSessionResourceManager.cs │ │ ├── AsyncTransaction.cs │ │ ├── Auth │ │ │ ├── AuthToken.cs │ │ │ ├── AuthTokenExtensions.cs │ │ │ ├── BasicAuthToken.cs │ │ │ ├── BearerAuthToken.cs │ │ │ ├── CustomAuthToken.cs │ │ │ ├── DefaultTlsNegotiator.cs │ │ │ ├── DelegateTlsNegotiator.cs │ │ │ ├── KerberosAuthToken.cs │ │ │ ├── Neo4jAuthTokenManager.cs │ │ │ ├── RotatingClientCertificateProvider.cs │ │ │ ├── StaticAuthTokenManager.cs │ │ │ └── StaticClientCertificateProvider.cs │ │ ├── BookmarkManagerFactory.cs │ │ ├── ConnectionPool.cs │ │ ├── ConnectionPoolStatus.cs │ │ ├── ConnectionValidator.cs │ │ ├── Connector │ │ │ ├── BoltHandshaker.cs │ │ │ ├── ByteBuffers.cs │ │ │ ├── DelegatedConnection.cs │ │ │ ├── IConnection.cs │ │ │ ├── IHostResolver.cs │ │ │ ├── IMessageWriter.cs │ │ │ ├── ISocketClient.cs │ │ │ ├── ITcpSocketClient.cs │ │ │ ├── PooledConnection.cs │ │ │ ├── Resolvers │ │ │ │ ├── CachingHostResolver.cs │ │ │ │ ├── DefaultHostResolver.cs │ │ │ │ ├── SystemHostResolver.cs │ │ │ │ └── SystemNetCoreHostResolver.cs │ │ │ ├── SocketClient.cs │ │ │ ├── SocketClientIoFactory.cs │ │ │ ├── SocketConnection.cs │ │ │ ├── TcpSocketClient.cs │ │ │ └── Trust │ │ │ │ ├── CertificateTrustManager.cs │ │ │ │ ├── ChainTrustManager.cs │ │ │ │ ├── InsecureTrustManager.cs │ │ │ │ └── PeerTrustManager.cs │ │ ├── DefaultBookmarkManager.cs │ │ ├── Driver.cs │ │ ├── DriverContext.cs │ │ ├── EncryptionManager.cs │ │ ├── ExceptionHandling │ │ │ ├── ErrorCodeAttribute.cs │ │ │ └── Neo4jExceptionFactory.cs │ │ ├── ExecuteQuery │ │ │ ├── DriverRowSource.cs │ │ │ ├── ExecutableQuery.cs │ │ │ ├── IQueryRowSource.cs │ │ │ ├── ReduceToList.cs │ │ │ ├── ReducedExecutableQuery.cs │ │ │ └── StreamProcessorExecutableQuery.cs │ │ ├── Extensions │ │ │ ├── ByteExtensions.cs │ │ │ ├── CollectionExtensions.cs │ │ │ ├── ConnectionExtensions.cs │ │ │ ├── ErrorExtensions.cs │ │ │ ├── MappingExtensions.cs │ │ │ ├── StreamExtensions.cs │ │ │ ├── TaskExtensions.cs │ │ │ ├── TypeExtensions.cs │ │ │ └── UtilityExtensions.cs │ │ ├── GqlCompliance │ │ │ └── GqlErrors.cs │ │ ├── Helpers │ │ │ ├── CertHelper.cs │ │ │ ├── RuntimeHelper.cs │ │ │ ├── SimpleWildcardHelper.cs │ │ │ ├── TemporalHelpers.cs │ │ │ ├── Throw.cs │ │ │ └── UniqueIdGenerator.cs │ │ ├── HomeDbCaching │ │ │ ├── HomeDbCache.cs │ │ │ ├── HomeDbCacheKey.cs │ │ │ ├── HomeDbCacheKeyProvider.cs │ │ │ └── IHomeDbCache.cs │ │ ├── IConnectionPool.cs │ │ ├── IConnectionProvider.cs │ │ ├── IConnectionReleaseManager.cs │ │ ├── IInternalAsyncSession.cs │ │ ├── IInternalAsyncTransaction.cs │ │ ├── IInternalDriver.cs │ │ ├── IInternalResultCursor.cs │ │ ├── IO │ │ │ ├── ChunkReader.cs │ │ │ ├── ChunkWriter.cs │ │ │ ├── Constants.cs │ │ │ ├── IChunkReader.cs │ │ │ ├── IMessageReader.cs │ │ │ ├── IPackStreamSerializer.cs │ │ │ ├── MessageReader.cs │ │ │ ├── MessageSerializers │ │ │ │ ├── BeginMessageSerializer.cs │ │ │ │ ├── CommitMessageSerializer.cs │ │ │ │ ├── DiscardMessageSerializer.cs │ │ │ │ ├── FailureMessageSerializer.cs │ │ │ │ ├── GoodbyeMessageSerializer.cs │ │ │ │ ├── HelloMessageSerializer.cs │ │ │ │ ├── IgnoredMessageSerializer.cs │ │ │ │ ├── LogoffMessageSerializer.cs │ │ │ │ ├── LogonMessageSerializer.cs │ │ │ │ ├── PullAllMessageSerializer.cs │ │ │ │ ├── PullMessageSerializer.cs │ │ │ │ ├── RecordMessageSerializer.cs │ │ │ │ ├── ResetMessageSerializer.cs │ │ │ │ ├── RollbackMessageSerializer.cs │ │ │ │ ├── RouteMessageSerializer.cs │ │ │ │ ├── RouteMessageSerializerV43.cs │ │ │ │ ├── RunWithMetadataMessageSerializer.cs │ │ │ │ ├── SuccessMessageSerializer.cs │ │ │ │ └── TelemetryMessageSerializer.cs │ │ │ ├── MessageWriter.cs │ │ │ ├── PackStream.cs │ │ │ ├── PackStreamBitConverter.cs │ │ │ ├── PackStreamFactory.cs │ │ │ ├── PackStreamReader.cs │ │ │ ├── PackStreamType.cs │ │ │ ├── PackStreamWriter.cs │ │ │ ├── PipelinedMessageReader.cs │ │ │ ├── ReadOnlySerializer.cs │ │ │ ├── SpanPackStreamReader.cs │ │ │ ├── ValueSerializers │ │ │ │ ├── ElementNodeSerializer.cs │ │ │ │ ├── ElementRelationshipSerializer.cs │ │ │ │ ├── ElementUnboundRelationshipSerializer.cs │ │ │ │ ├── NodeSerializer.cs │ │ │ │ ├── PathSerializer.cs │ │ │ │ ├── PointSerializer.cs │ │ │ │ ├── RelationshipSerializer.cs │ │ │ │ ├── Temporal │ │ │ │ │ ├── DurationSerializer.cs │ │ │ │ │ ├── LocalDateSerializer.cs │ │ │ │ │ ├── LocalDateTimeSerializer.cs │ │ │ │ │ ├── LocalTimeSerializer.cs │ │ │ │ │ ├── OffsetTimeSerializer.cs │ │ │ │ │ ├── SystemDateTimeOffsetSerializer.cs │ │ │ │ │ ├── SystemDateTimeSerializer.cs │ │ │ │ │ ├── SystemTimeSpanSerializer.cs │ │ │ │ │ ├── UtcZonedDateTimeSerializer.cs │ │ │ │ │ └── ZonedDateTimeSerializer.cs │ │ │ │ └── UnboundRelationshipSerializer.cs │ │ │ └── WriteOnlySerializer.cs │ │ ├── IPooledConnection.cs │ │ ├── InitialServerAddressProvider.cs │ │ ├── InternalBookmarks.cs │ │ ├── Logging │ │ │ ├── DriverLoggerUtil.cs │ │ │ ├── NullLogger.cs │ │ │ ├── PrefixLogger.cs │ │ │ └── ReformattedLogger.cs │ │ ├── Mapping │ │ │ ├── BuiltMapper.cs │ │ │ ├── ConventionTranslation │ │ │ │ └── NoOpConventionTranslator.cs │ │ │ ├── DefaultMapper.cs │ │ │ ├── DelegateMapper.cs │ │ │ ├── DictAsRecord.cs │ │ │ ├── EntityMappingInfo.cs │ │ │ ├── MappableValueProvider.cs │ │ │ ├── MappedListCreator.cs │ │ │ ├── MappingBuilder.cs │ │ │ ├── MappingSourceDelegateBuilder.cs │ │ │ ├── ParameterMapper.cs │ │ │ ├── RecordPathFinder.cs │ │ │ └── TypeConversion │ │ │ │ ├── IMappingTypeConversionManager.cs │ │ │ │ └── MappingTypeConversionManager.cs │ │ ├── MessageHandling │ │ │ ├── CommitResponseHandler.cs │ │ │ ├── HelloResponseHandler.cs │ │ │ ├── IBookmarksTracker.cs │ │ │ ├── IMetadataCollector.cs │ │ │ ├── IResponseHandler.cs │ │ │ ├── IResponsePipeline.cs │ │ │ ├── IResponsePipelineError.cs │ │ │ ├── Metadata │ │ │ │ ├── BoltPatchCollector.cs │ │ │ │ ├── BookmarkCollector.cs │ │ │ │ ├── ConfigurationHintsCollector.cs │ │ │ │ ├── ConnectionIdCollector.cs │ │ │ │ ├── CountersCollector.cs │ │ │ │ ├── DatabaseInfoCollector.cs │ │ │ │ ├── DurationCollectors.cs │ │ │ │ ├── FieldsCollector.cs │ │ │ │ ├── GqlStatusObjectsAndNotifications.cs │ │ │ │ ├── GqlStatusObjectsAndNotificationsCollector.cs │ │ │ │ ├── HasMoreCollector.cs │ │ │ │ ├── PlanCollector.cs │ │ │ │ ├── ProfiledPlanCollector.cs │ │ │ │ ├── QueryIdCollector.cs │ │ │ │ ├── RoutingTableCollector.cs │ │ │ │ ├── ServerVersionCollector.cs │ │ │ │ └── TypeCollector.cs │ │ │ ├── MetadataCollectingResponseHandler.cs │ │ │ ├── NoOpResponseHandler.cs │ │ │ ├── ResponsePipeline.cs │ │ │ ├── ResponsePipelineError.cs │ │ │ ├── RouteResponseHandler.cs │ │ │ ├── TelemetryResponseHandler.cs │ │ │ ├── V3 │ │ │ │ ├── PullAllResponseHandler.cs │ │ │ │ └── RunResponseHandlerV3.cs │ │ │ └── V4 │ │ │ │ ├── BeginResponseHandler.cs │ │ │ │ ├── PullResponseHandler.cs │ │ │ │ └── RunResponseHandler.cs │ │ ├── Messaging │ │ │ ├── BeginMessage.cs │ │ │ ├── CommitMessage.cs │ │ │ ├── DiscardMessage.cs │ │ │ ├── FailureMessage.cs │ │ │ ├── GoodbyeMessage.cs │ │ │ ├── HelloMessage.cs │ │ │ ├── IMessage.cs │ │ │ ├── IgnoredMessage.cs │ │ │ ├── LogoffMessage.cs │ │ │ ├── LogonMessage.cs │ │ │ ├── PullAllMessage.cs │ │ │ ├── PullMessage.cs │ │ │ ├── RecordMessage.cs │ │ │ ├── ResetMessage.cs │ │ │ ├── ResultHandleMessage.cs │ │ │ ├── RollbackMessage.cs │ │ │ ├── RouteMessage.cs │ │ │ ├── RouteMessageV43.cs │ │ │ ├── RunWithMetadataMessage.cs │ │ │ ├── SuccessMessage.cs │ │ │ ├── TelemetryMessage.cs │ │ │ ├── TransactionStartingMessage.cs │ │ │ └── Utils │ │ │ │ ├── BoltAgentBuilder.cs │ │ │ │ └── NotificationsMetadataWriter.cs │ │ ├── Metrics │ │ │ ├── ConnectionPoolMetrics.cs │ │ │ ├── DefaultMetrics.cs │ │ │ ├── IConnectionPoolListener.cs │ │ │ └── IMetrics.cs │ │ ├── PassthroughServerAddressResolver.cs │ │ ├── PoolStatus.cs │ │ ├── PooledConnectionFactory.cs │ │ ├── Protocol │ │ │ ├── AutoCommitParams.cs │ │ │ ├── BeginTransactionParams.cs │ │ │ ├── BoltProtocol.cs │ │ │ ├── BoltProtocolFactory.cs │ │ │ ├── BoltProtocolHandlerFactory.cs │ │ │ ├── BoltProtocolMessageFactory.cs │ │ │ ├── BoltProtocolV3.cs │ │ │ ├── BoltProtocolVersion.cs │ │ │ ├── IBoltProtocol.cs │ │ │ ├── MessageFormat.cs │ │ │ └── Utility │ │ │ │ ├── BookmarksTracker.cs │ │ │ │ ├── ConnectionResourceHandler.cs │ │ │ │ └── NullTransaction.cs │ │ ├── Result │ │ │ ├── CursorEnumerator.cs │ │ │ ├── IResultStream.cs │ │ │ ├── IResultStreamBuilder.cs │ │ │ ├── Record.cs │ │ │ ├── ResultCursor.cs │ │ │ ├── ResultCursorBuilder.cs │ │ │ └── Summary │ │ │ │ ├── Counters.cs │ │ │ │ ├── CursorMetadata.cs │ │ │ │ ├── DatabaseInfo.cs │ │ │ │ ├── GqlStatusObject.cs │ │ │ │ ├── IUpdateableInfo.cs │ │ │ │ ├── InputPosition.cs │ │ │ │ ├── Notification.cs │ │ │ │ ├── Plan.cs │ │ │ │ ├── ProfiledPlan.cs │ │ │ │ ├── ServerInfo.cs │ │ │ │ └── SummaryBuilder.cs │ │ ├── Routing │ │ │ ├── ClusterConnection.cs │ │ │ ├── ClusterConnectionPool.cs │ │ │ ├── ClusterDiscovery.cs │ │ │ ├── ConnectionPoolFactory.cs │ │ │ ├── IClusterConnectionPool.cs │ │ │ ├── IClusterConnectionPoolManager.cs │ │ │ ├── IDiscovery.cs │ │ │ ├── IErrorHandler.cs │ │ │ ├── ILoadBalancingStrategy.cs │ │ │ ├── IRoutingTable.cs │ │ │ ├── IRoutingTableManager.cs │ │ │ ├── LeastConnectedLoadBalancingStrategy.cs │ │ │ ├── LoadBalancer.cs │ │ │ ├── RoundRobinArrayIndex.cs │ │ │ ├── RoutingTable.cs │ │ │ └── RoutingTableManager.cs │ │ ├── Services │ │ │ └── DateTimeProvider.cs │ │ ├── Telemetry │ │ │ └── QueryApiType.cs │ │ ├── Temporal │ │ │ ├── TimeZoneMapping.cs │ │ │ └── windowsZones.xml │ │ ├── Types │ │ │ ├── IHasDateComponents.cs │ │ │ ├── IHasDateTimeComponents.cs │ │ │ ├── IHasTimeComponents.cs │ │ │ ├── ISegment.cs │ │ │ ├── IValue.cs │ │ │ ├── Node.cs │ │ │ ├── NotificationConfig.cs │ │ │ ├── NotificationsDisabledConfig.cs │ │ │ ├── Path.cs │ │ │ ├── Relationship.cs │ │ │ └── Segment.cs │ │ └── Util │ │ │ ├── ConcurrentHashSet.cs │ │ │ ├── ConcurrentOrderedSet.cs │ │ │ ├── ConfigBuilders.cs │ │ │ ├── ConnectionContext.cs │ │ │ ├── Neo4jUri.cs │ │ │ ├── PipeReaderMemoryPool.cs │ │ │ ├── ServerVersion.cs │ │ │ └── VarLong.cs │ ├── Neo4j.Driver.csproj │ ├── Neo4j.Driver.csproj.DotSettings │ ├── Preview │ │ └── GqlErrors │ │ │ └── IGqlErrorPreview.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Public │ │ ├── AccessMode.cs │ │ ├── Auth │ │ ├── AuthSchemes.cs │ │ ├── AuthTokenAndExpiration.cs │ │ ├── AuthTokenManagers.cs │ │ ├── AuthTokens.cs │ │ ├── ClientCertificateProviders.cs │ │ ├── IAuthToken.cs │ │ ├── IAuthTokenManager.cs │ │ ├── IClientCertificateProvider.cs │ │ ├── IRotatingClientCertificateProvider.cs │ │ └── ITlsNegotiator.cs │ │ ├── Bookmark.cs │ │ ├── BookmarkManagerConfig.cs │ │ ├── CertificateTrustRule.cs │ │ ├── Config.cs │ │ ├── ConfigBuilder.cs │ │ ├── EncryptionLevel.cs │ │ ├── Exceptions │ │ ├── AuthenticationException.cs │ │ ├── AuthorizationException.cs │ │ ├── ClientException.cs │ │ ├── ConnectionReadTimeoutException.cs │ │ ├── DatabaseException.cs │ │ ├── FatalDiscoveryException.cs │ │ ├── ForbiddenException.cs │ │ ├── InvalidBookmarkException.cs │ │ ├── InvalidBookmarkMixtureException.cs │ │ ├── Neo4jException.cs │ │ ├── ProtocolException.cs │ │ ├── ResultConsumedException.cs │ │ ├── SecurityException.cs │ │ ├── ServiceUnavailableException.cs │ │ ├── SessionExpiredException.cs │ │ ├── StatementArgumentException.cs │ │ ├── TokenExpiredException.cs │ │ ├── TransactionClosedException.cs │ │ ├── TransactionNestingException.cs │ │ ├── TransactionTerminatedException.cs │ │ ├── TransientException.cs │ │ ├── TypeException.cs │ │ ├── UnknownSecurityException.cs │ │ ├── UnsupportedFeatureException.cs │ │ ├── ValueOverflowException.cs │ │ └── ValueTruncationException.cs │ │ ├── ExecuteQuery │ │ ├── EagerResult.cs │ │ ├── IExecutableQuery.cs │ │ └── QueryConfig.cs │ │ ├── Extensions │ │ ├── ResultCursorExtensions.cs │ │ └── ValueExtensions.cs │ │ ├── GraphDatabase.cs │ │ ├── IAsyncQueryRunner.cs │ │ ├── IAsyncSession.cs │ │ ├── IAsyncTransaction.cs │ │ ├── IBookmarkManager.cs │ │ ├── IBookmarkManagerFactory.cs │ │ ├── IDriver.cs │ │ ├── ILogger.cs │ │ ├── IRecord.cs │ │ ├── IResultCursor.cs │ │ ├── IServerAddressResolver.cs │ │ ├── IsExternalInit.cs │ │ ├── Mapping │ │ ├── AsyncEnumerableExtensions.cs │ │ ├── ConventionTranslation │ │ │ ├── ConventionTranslator.cs │ │ │ ├── FieldCaseConvention.cs │ │ │ ├── IConventionTranslator.cs │ │ │ ├── IFieldFormatter.cs │ │ │ ├── IIdentifierParser.cs │ │ │ ├── IdentifierCaseConvention.cs │ │ │ ├── StandardCaseFormatter.cs │ │ │ └── StandardCaseParser.cs │ │ ├── DelegateAsyncEnumerableExtensions.cs │ │ ├── DelegateExecutableQueryMappingExtensions.cs │ │ ├── DelegateMappingRecordExtensions.cs │ │ ├── EntityExtensions.cs │ │ ├── ExecutableQueryMappingExtensions.cs │ │ ├── IMappingBuilder.cs │ │ ├── IMappingProvider.cs │ │ ├── IRecordMapper.cs │ │ ├── MappingConstructorAttribute.cs │ │ ├── MappingFailedException.cs │ │ ├── MappingIgnoredAttribute.cs │ │ ├── MappingOptionalAttribute.cs │ │ ├── MappingSourceAttribute.cs │ │ ├── RecordExtensions.cs │ │ └── RecordObjectMapping.cs │ │ ├── Query.cs │ │ ├── RoutingControl.cs │ │ ├── ServerAddress.cs │ │ ├── SessionConfig.cs │ │ ├── Summary │ │ ├── ICounters.cs │ │ ├── IDatabaseInfo.cs │ │ ├── IGqlStatusObject.cs │ │ ├── IInputPosition.cs │ │ ├── INotification.cs │ │ ├── IPlan.cs │ │ ├── IProfiledPlan.cs │ │ ├── IResultSummary.cs │ │ ├── IServerInfo.cs │ │ ├── NotificationCategory.cs │ │ ├── NotificationClassification.cs │ │ ├── NotificationSeverity.cs │ │ └── QueryType.cs │ │ ├── TransactionConfig.cs │ │ ├── TrustManager.cs │ │ └── Types │ │ ├── Category.cs │ │ ├── Classification.cs │ │ ├── Duration.cs │ │ ├── IEntity.cs │ │ ├── INode.cs │ │ ├── INotificationsConfig.cs │ │ ├── IPath.cs │ │ ├── IRelationship.cs │ │ ├── LocalDate.cs │ │ ├── LocalDateTime.cs │ │ ├── LocalTime.cs │ │ ├── OffsetTime.cs │ │ ├── Point.cs │ │ ├── Severity.cs │ │ ├── TemporalValue.cs │ │ ├── Zone.cs │ │ ├── ZoneId.cs │ │ ├── ZoneOffset.cs │ │ └── ZonedDateTime.cs ├── common.props └── runTests.ps1 ├── README.md ├── docfx ├── .gitignore ├── docfx.json ├── filterConfig.yaml ├── images │ └── neo4j-logo.png ├── index.md ├── neo4j-template │ └── public │ │ └── main.css └── toc.yml └── testkit ├── Dockerfile ├── backend.py ├── build.py ├── integration.py ├── stress.py ├── testkit.json └── unittests.py /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 1. Go to '...' 15 | 2. Click on '....' 16 | 3. Scroll down to '....' 17 | 4. See error 18 | 19 | **Expected behavior** 20 | A clear and concise description of what you expected to happen. 21 | 22 | **Version Info (please complete the following information):** 23 | - .NET Version: [e.g. .NET Framework 4.6.2] 24 | - .NET Driver Version [e.g. 4.4.0] 25 | - Neo4j Server Version & Edition [e.g. Aura Pro 5.20.0] 26 | 27 | **Additional context** 28 | Add any other context about the problem here. 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: feature 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.snyk: -------------------------------------------------------------------------------- 1 | # Snyk (https://snyk.io) policy file 2 | exclude: 3 | code: 4 | - testkit/** 5 | - Neo4j.Driver/Neo4j.Driver.Tests/** 6 | - Neo4j.Driver/Neo4j.Driver.Tests.*/** -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Neo4j 2 | Copyright (c) Neo4j Sweden AB (referred to in this notice as "Neo4j") [https://neo4j.com] 3 | 4 | This product includes software ("Software") developed by Neo4j -------------------------------------------------------------------------------- /Neo4j.Driver/IdentityPubKey.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j/neo4j-dotnet-driver/404334ee6f1496dd54ab53c8fc2e939bddbbdf68/Neo4j.Driver/IdentityPubKey.snk -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j-icon-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j/neo4j-dotnet-driver/404334ee6f1496dd54ab53c8fc2e939bddbbdf68/Neo4j.Driver/Neo4j-icon-color.png -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Reactive/Internal/RxExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Reactive.Linq; 18 | 19 | namespace Neo4j.Driver.Internal; 20 | 21 | internal static class RxExtensions 22 | { 23 | public static IObservable CatchAndThrow( 24 | this IObservable source, 25 | Func> handler) 26 | { 27 | return source.Catch((Exception exc) => handler(exc).Concat(Observable.Throw(exc))); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Abstractions/IRecordConsumer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.BenchkitBackend.Abstractions; 17 | 18 | internal interface IRecordConsumer 19 | { 20 | void ConsumeRecords(IEnumerable records); 21 | } 22 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Abstractions/IWorkloadExecutor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Tests.BenchkitBackend.Types; 17 | 18 | namespace Neo4j.Driver.Tests.BenchkitBackend.Abstractions; 19 | 20 | /// Defines methods for executing a workload. 21 | public interface IWorkloadExecutor 22 | { 23 | /// Execute a workload. 24 | /// The workload to execute. 25 | /// A task that completes when the workload has been executed. 26 | Task ExecuteWorkloadAsync(Workload workload); 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Abstractions/IWorkloadExecutorSelector.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Tests.BenchkitBackend.Types; 17 | 18 | namespace Neo4j.Driver.Tests.BenchkitBackend.Abstractions; 19 | 20 | /// Methods for forwarding a workload to the correct executor. 21 | public interface IWorkloadExecutorSelector 22 | { 23 | /// Gets the correct executor for the workload. 24 | /// The workload to execute. 25 | public IWorkloadExecutor GetExecutor(Workload workload); 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Abstractions/IWorkloadSessionBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Tests.BenchkitBackend.Types; 17 | 18 | namespace Neo4j.Driver.Tests.BenchkitBackend.Abstractions; 19 | 20 | internal interface IWorkloadSessionBuilder 21 | { 22 | IAsyncSession BuildSession(IDriver driver, Workload workload); 23 | } 24 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Configuration/BenchkitBackendConfiguration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.BenchkitBackend.Configuration; 17 | 18 | internal class BenchkitBackendConfiguration 19 | { 20 | public int BackendPort { get; set; } 21 | public string Neo4jScheme { get; set; } = ""; 22 | public string Neo4jHost { get; set; } = ""; 23 | public int Neo4jPort { get; set; } 24 | public string Neo4jUser { get; set; } = ""; 25 | public string Neo4jPassword { get; set; } = ""; 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Dockerfile: -------------------------------------------------------------------------------- 1 | # The build context for building this dockerfile needs to be {repo-root}/Neo4j.Driver 2 | 3 | # Stage 1: Build 4 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 5 | WORKDIR /src 6 | 7 | # copy the Neo4j.Driver and Neo4j.Driver.Tests.BenchkitBackend source code 8 | COPY ./common.props /src/common.props 9 | COPY ./Neo4j.Driver /src/Neo4j.Driver 10 | COPY ./Neo4j.Driver.Tests.BenchkitBackend /src/Neo4j.Driver.Tests.BenchkitBackend 11 | 12 | # build 13 | WORKDIR /src/Neo4j.Driver.Tests.BenchkitBackend 14 | RUN dotnet publish -c Release -o /app 15 | 16 | # Stage 2: Runtime 17 | FROM mcr.microsoft.com/dotnet/aspnet:8.0 18 | 19 | RUN apt update 20 | RUN apt install wget -y 21 | WORKDIR /app 22 | 23 | # Copy from build stage 24 | COPY --from=build /app . 25 | 26 | ENTRYPOINT ["dotnet", "Neo4j.Driver.Tests.BenchkitBackend.dll"] 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Implementations/RecordConsumer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Tests.BenchkitBackend.Abstractions; 17 | 18 | namespace Neo4j.Driver.Tests.BenchkitBackend.Implementations; 19 | 20 | using ILogger = Microsoft.Extensions.Logging.ILogger; 21 | 22 | internal class RecordConsumer( 23 | ILogger logger) 24 | : IRecordConsumer 25 | { 26 | public void ConsumeRecords(IEnumerable records) 27 | { 28 | foreach (var record in records) 29 | { 30 | logger.LogTrace("Consuming record with {Fields} fields", record.Keys.Count); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Neo4j.Driver.Tests.BenchkitBackend.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True 3 | True 4 | True 5 | True -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "kestrel": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:9000/swagger/index.html", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Types/Method.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.BenchkitBackend.Types; 17 | 18 | /// Different methods in the driver that can be used to execute a query. 19 | public enum Method 20 | { 21 | /// Use the driver-level ExecuteQuery method. 22 | ExecuteQuery, 23 | 24 | /// Use Session.Run to execute the query. 25 | SessionRun, 26 | 27 | /// Use Session.ExecuteRead to execute the query. 28 | ExecuteRead, 29 | 30 | /// Use Session.ExecuteWrite to execute the query. 31 | ExecuteWrite 32 | } 33 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Types/Mode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.BenchkitBackend.Types; 17 | 18 | /// Defines the parallel/sequential mode in which the queries should be executed. 19 | public enum Mode 20 | { 21 | /// Execute the queries sequentially in a single transaction. 22 | SequentialQueries, 23 | 24 | /// Execute each query in a separate transaction sequentially in the same session. 25 | SequentialTransactions, 26 | 27 | /// Execute each query in a separate session sequentially. 28 | SequentialSessions, 29 | 30 | /// Execute the queries in parallel in a session per query. 31 | ParallelSessions 32 | } 33 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/Types/WorkloadQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.BenchkitBackend.Types; 17 | 18 | /// A query that is part of a workload. 19 | public class WorkloadQuery 20 | { 21 | /// The query text. 22 | public string Text { get; set; } = ""; 23 | 24 | /// The parameters to use when executing the query. 25 | public Dictionary Parameters { get; set; } = new(); 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.BenchkitBackend/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Serilog": { 3 | "MinimumLevel": { 4 | "Default": "Debug" 5 | } 6 | }, 7 | "AllowedHosts": "*", 8 | "BenchkitBackend": { 9 | "BackendPort": 9000, 10 | "Neo4jScheme": "neo4j", 11 | "Neo4jHost": "localhost", 12 | "Neo4jPort": 7687, 13 | "Neo4jUser": "neo4j", 14 | "Neo4jPassword": "password" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Internals/CcIntegrationCollection.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Xunit; 17 | 18 | namespace Neo4j.Driver.IntegrationTests.Internals; 19 | 20 | [CollectionDefinition(CollectionName)] 21 | public class CcIntegrationCollection : ICollectionFixture 22 | { 23 | public const string CollectionName = "CausalClusterIntegration"; 24 | // This class has no code, and is never created. Its purpose is simply 25 | // to be the place to apply [CollectionDefinition] and all the 26 | // ICollectionFixture<> interfaces. 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Internals/Cluster/ICausalCluster.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.IntegrationTests.Internals; 19 | 20 | public interface ICausalCluster : IDisposable 21 | { 22 | Uri BoltRoutingUri { get; } 23 | 24 | IAuthToken AuthToken { get; } 25 | 26 | void Configure(ConfigBuilder builder); 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Internals/IInstaller.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.IntegrationTests.Internals; 17 | 18 | public interface IInstaller 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Internals/ISingleInstance.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.IntegrationTests.Internals; 19 | 20 | public interface ISingleInstance 21 | { 22 | Uri HttpUri { get; } 23 | Uri BoltUri { get; } 24 | Uri BoltRoutingUri { get; } 25 | string HomePath { get; } 26 | IAuthToken AuthToken { get; } 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Internals/SaIntegrationCollection.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Xunit; 17 | 18 | namespace Neo4j.Driver.IntegrationTests.Internals; 19 | 20 | [CollectionDefinition(CollectionName)] 21 | public class SaIntegrationCollection : ICollectionFixture 22 | { 23 | public const string CollectionName = "StandAloneIntegration"; 24 | // This class has no code, and is never created. Its purpose is simply 25 | // to be the place to apply [CollectionDefinition] and all the 26 | // ICollectionFixture<> interfaces. 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Internals/ShellCommandRunnerTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.IntegrationTests.Internals; 17 | 18 | public abstract class ShellCommandRunnerTests 19 | { 20 | public class RunCommandMethod 21 | { 22 | [ShouldNotRunInTestKitFact] 23 | public void ShouldRunCommand() 24 | { 25 | // first we got a local command runner 26 | var runner = ShellCommandRunnerFactory.Create(); 27 | runner.RunCommand("neoctrl-install", "-h"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V3/connection_error_on_commit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {} 6 | S: SUCCESS {} 7 | C: RUN "CREATE (n {name: 'Bob'})" {} {} 8 | PULL_ALL 9 | S: SUCCESS {} 10 | SUCCESS {} 11 | C: COMMIT 12 | S: -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V3/fail_to_auth.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | S: FAILURE {"code": "Neo.ClientError.Security.Unauthorized", "message": "blabla"} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V3/get_routing_table.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO PULL_ALL 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {"mode": "r"} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [300, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 12 | PULL_ALL 13 | S: SUCCESS {"fields": ["name"]} 14 | RECORD ["Alice"] 15 | RECORD ["Bob"] 16 | RECORD ["Eve"] 17 | SUCCESS {} 18 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V3/get_routing_table_with_context.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO PULL_ALL 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001", "policy": "my_policy", "region": "china"}} {"mode": "r"} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [300, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 12 | PULL_ALL 13 | S: SUCCESS {"fields": ["name"]} 14 | RECORD ["Alice"] 15 | RECORD ["Bob"] 16 | SUCCESS {} 17 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V3/rollback_error.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {} 6 | S: SUCCESS {} 7 | C: RUN "CREATE (n {name:'Alice'}) RETURN n.name AS name" {} {} 8 | PULL_ALL 9 | S: FAILURE {"code": "Neo.TransientError.General.DatabaseUnavailable", "message": "Unable to run any"} 10 | IGNORED 11 | C: RESET 12 | S: SUCCESS {} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V3/supports_multidb.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V3/verify_connectivity.script: -------------------------------------------------------------------------------- 1 | !: BOLT 3 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO PULL_ALL 5 | 6 | C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": {"address": "127.0.0.1:9001"}} {"mode": "r"} 7 | PULL_ALL 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [300, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 10 | SUCCESS {} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/accessmode_reader_explicit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {"mode": "r"} 6 | S: SUCCESS {} 7 | C: RUN "RETURN $x" {"x": 1} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {"fields": ["x"]} 10 | RECORD [1] 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {} 14 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/accessmode_reader_func.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {"mode": "r"} 6 | S: SUCCESS {} 7 | C: RUN "RETURN $x" {"x": 1} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {"fields": ["x"]} 10 | RECORD [1] 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {} 14 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/accessmode_reader_implicit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "RETURN $x" {"x": 1} {"mode": "r"} 6 | PULL {"n": 1000} 7 | S: SUCCESS {"fields": ["x"]} 8 | RECORD [1] 9 | SUCCESS {} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/accessmode_router.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": null} {"mode": "r", "db": "system"} 6 | PULL {"n": -1} 7 | S: SUCCESS {"fields": ["ttl", "servers"]} 8 | RECORD [300, [{"addresses": ["127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9003"], "role": "READ"},{"addresses": ["127.0.0.1:9001"], "role": "ROUTE"}]] 9 | SUCCESS {} 10 | S: 11 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/accessmode_writer_explicit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {} 6 | S: SUCCESS {} 7 | C: RUN "CREATE (n: { id: $x }) RETURN $x" {"x": 1} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {"fields": ["x"]} 10 | RECORD [1] 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {} 14 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/accessmode_writer_func.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {} 6 | S: SUCCESS {} 7 | C: RUN "CREATE (n: { id: $x }) RETURN $x" {"x": 1} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {"fields": ["x"]} 10 | RECORD [1] 11 | SUCCESS {} 12 | C: COMMIT 13 | S: SUCCESS {} 14 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/accessmode_writer_implicit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CREATE (n: { id: $x }) RETURN $x" {"x": 1} {} 6 | PULL {"n": 1000} 7 | S: SUCCESS {"fields": ["x"]} 8 | RECORD [1] 9 | SUCCESS {} 10 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/acquire_endpoints_aDatabase.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": "aDatabase"} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [1500, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/acquire_endpoints_aDatabase_no_servers.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database":"aDatabase"} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [1500, []] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/acquire_endpoints_aDatabase_with_bookmark.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": "aDatabase"} {"bookmarks": ["system:1111", "aDatabase:5555"], "mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [1500, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS { "bookmark": "system:2222"} 11 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/acquire_endpoints_db_not_found.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": "aDatabase"} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: FAILURE {"code": "Neo.ClientError.Database.DatabaseNotFound", "message": "database not found"} 9 | IGNORED 10 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/acquire_endpoints_default_database.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": null} {"mode": "r", "db": "system"} 7 | PULL {"n": -1} 8 | S: SUCCESS {"fields": ["ttl", "servers"]} 9 | RECORD [1500, [{"addresses": ["127.0.0.1:9007","127.0.0.1:9008"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9005","127.0.0.1:9006"], "role": "READ"},{"addresses": ["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"], "role": "ROUTE"}]] 10 | SUCCESS {} 11 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/connection_error_on_commit.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {} 6 | S: SUCCESS {} 7 | C: RUN "CREATE (n {name: 'Bob'})" {} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {} 10 | SUCCESS {} 11 | C: COMMIT 12 | S: -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/discard_streaming_records.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO RESET 3 | !: AUTO HELLO 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "UNWIND [1,2,3,4] AS n RETURN n" {} {} 7 | S: SUCCESS {"t_first": 110, "fields": ["n"]} 8 | C: DISCARD {"n": -1} 9 | S: SUCCESS {"type": "r", "t_last": 3, "db": "neo4j"} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/discard_streaming_records_tx.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO RESET 3 | !: AUTO HELLO 4 | !: AUTO GOODBYE 5 | 6 | C: BEGIN { "mode": "r" } 7 | S: SUCCESS {} 8 | C: RUN "UNWIND [1,2,3,4] AS n RETURN n" {} {} 9 | S: SUCCESS {"t_first": 110, "fields": ["n"]} 10 | C: DISCARD {"n": -1} 11 | S: SUCCESS {"type": "r", "t_last": 3, "db": "neo4j"} 12 | C: COMMIT 13 | S: SUCCESS {"bookmark": "e57085e2-727f-43f3-b632-7ec57978806e:117"} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/fail_to_auth.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | S: FAILURE {"code": "Neo.ClientError.Security.Unauthorized", "message": "blabla"} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/get_routing_table.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": null} {"mode": "r", "db": "system"} 6 | PULL {"n": -1} 7 | S: SUCCESS {"fields": ["ttl", "servers"]} 8 | RECORD [300, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 9 | SUCCESS {} 10 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 11 | PULL {"n": 1000} 12 | S: SUCCESS {"fields": ["name"]} 13 | RECORD ["Alice"] 14 | RECORD ["Bob"] 15 | RECORD ["Eve"] 16 | SUCCESS {} 17 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/get_routing_table_only.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "x.example.com:7687"}, "database": null} {"mode": "r", "db": "system"} 6 | PULL {"n": -1} 7 | S: SUCCESS {"fields": ["ttl", "servers"]} 8 | RECORD [300, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001"], "role": "ROUTE"}]] 9 | SUCCESS {} 10 | S: -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/get_routing_table_with_context.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001", "policy": "my_policy", "region": "china"}, "database": null} {"mode": "r", "db": "system"} 6 | PULL {"n": -1} 7 | S: SUCCESS {"fields": ["ttl", "servers"]} 8 | RECORD [300, [{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001", "127.0.0.1:9002"], "role": "ROUTE"}]] 9 | SUCCESS {} 10 | C: RUN "MATCH (n) RETURN n.name AS name" {} {} 11 | PULL {"n": 1000} 12 | S: SUCCESS {"fields": ["name"]} 13 | RECORD ["Alice"] 14 | RECORD ["Bob"] 15 | SUCCESS {} 16 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/multiple_bookmarks.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {"bookmarks": ["neo4j:bookmark:v1:tx5", "neo4j:bookmark:v1:tx29", "neo4j:bookmark:v1:tx94", "neo4j:bookmark:v1:tx56", "neo4j:bookmark:v1:tx16", "neo4j:bookmark:v1:tx68"]} 6 | S: SUCCESS {} 7 | C: RUN "CREATE (n {name:'Bob'})" {} {} 8 | PULL {"n": 1000} 9 | S: SUCCESS {} 10 | SUCCESS {} 11 | C: COMMIT 12 | S: SUCCESS {"bookmark": "neo4j:bookmark:v1:tx95"} 13 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/read.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS {} 13 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/read_from_aDatabase.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"mode": "r", "db": "aDatabase"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS {} 13 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/read_from_aDatabase_with_bookmark.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {"bookmarks": ["system:1111", "aDatabase:5555"], "mode": "r", "db": "aDatabase"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS { "bookmark": "aDatabase:6666" } 13 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/return_1.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO COMMIT 5 | !: AUTO ROLLBACK 6 | !: AUTO BEGIN 7 | 8 | C: RUN "RETURN 1" {} {"mode": "r"} 9 | PULL {"n": 1000} 10 | S: SUCCESS {"fields": ["1"]} 11 | RECORD [1] 12 | SUCCESS {} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/rollback_error.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: BEGIN {} 6 | S: SUCCESS {} 7 | C: RUN "CREATE (n {name:'Alice'}) RETURN n.name AS name" {} {} 8 | PULL {"n": 1000} 9 | S: FAILURE {"code": "Neo.TransientError.General.DatabaseUnavailable", "message": "Unable to run any"} 10 | IGNORED 11 | C: RESET 12 | S: SUCCESS {} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/streaming_records.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO RESET 3 | !: AUTO HELLO 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL { "n": 2 } 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | SUCCESS {"has_more": true} 12 | C: PULL { "n": 2 } 13 | S: RECORD ["Tina"] 14 | SUCCESS {} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/streaming_records_all.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO RESET 3 | !: AUTO HELLO 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (n) RETURN n.name" {} {} 7 | PULL { "n": 1000 } 8 | S: SUCCESS {"fields": ["n.name"]} 9 | RECORD ["Bob"] 10 | RECORD ["Alice"] 11 | RECORD ["Tina"] 12 | SUCCESS {} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/supports_multidb.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/verify_connectivity.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | 5 | C: RUN "CALL dbms.routing.getRoutingTable($context, $database)" {"context": {"address": "127.0.0.1:9001"}, "database": "system"} {"mode": "r", "db": "system"} 6 | PULL {"n": -1} 7 | S: SUCCESS {"fields": ["ttl", "servers"]} 8 | RECORD [300, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001"], "role": "ROUTE"}]] 9 | SUCCESS {} 10 | S: -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4/write_to_aDatabase.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "CREATE (n {name:'Bob'})" {} {"db": "aDatabase"} 7 | PULL {"n": 1000} 8 | S: SUCCESS {"fields": []} 9 | SUCCESS {} 10 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Resources/V4_1/noop.script: -------------------------------------------------------------------------------- 1 | !: BOLT 4 2 | !: AUTO HELLO 3 | !: AUTO RESET 4 | !: AUTO GOODBYE 5 | 6 | C: RUN "MATCH (N) RETURN n.name" {} {} 7 | PULL { "n": 1000 } 8 | S: SUCCESS {"fields": ["n.name"]} 9 | 10 | RECORD ["Foo"] 11 | 12 | RECORD ["Bar"] 13 | 14 | 15 | RECORD ["Baz"] 16 | SUCCESS {} -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Stress/IAsyncCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading.Tasks; 17 | 18 | namespace Neo4j.Driver.IntegrationTests.Stress; 19 | 20 | public interface IAsyncCommand 21 | { 22 | Task ExecuteAsync(StressTestContext context); 23 | } 24 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Stress/IBlockingCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.IntegrationTests.Stress; 17 | 18 | public interface IBlockingCommand 19 | { 20 | void Execute(StressTestContext context); 21 | } 22 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/Stress/IRxCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.IntegrationTests.Stress; 17 | 18 | public interface IRxCommand : IAsyncCommand 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.Integration/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "parallelizeTestCollections": false 3 | } 4 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/.editorconfig: -------------------------------------------------------------------------------- 1 | [Protocol/**/*.cs] 2 | resharper_unused_type_global_highlighting = None -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Exceptions/DriverExceptionWrapper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Tests.TestBackend.Exceptions; 19 | 20 | public class DriverExceptionWrapper : Exception 21 | { 22 | public DriverExceptionWrapper() 23 | { 24 | } 25 | 26 | public DriverExceptionWrapper(Exception inner) : base(null, inner) 27 | { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Exceptions/FrontendException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Tests.TestBackend.Exceptions; 19 | 20 | public class FrontendException : Exception 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Neo4j.Driver.Tests.TestBackend.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | false 5 | Exe 6 | net6.0 7 | true 8 | true 9 | Debug;Release;ReleaseSigned;DebugDelaySigned 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Program.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "framework": { 4 | "name": "Microsoft.NETCore.App", 5 | "version": "2.0.0" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "NutKitDotNet": { 4 | "commandName": "Project", 5 | "commandLineArgs": "0.0.0.0 9876" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Auth/AuthTokenManagerClose.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Auth; 17 | 18 | internal class AuthTokenManagerClose : ProtocolObject 19 | { 20 | public AuthTokenManagerCloseType data { get; set; } = new(); 21 | 22 | public override string Respond() 23 | { 24 | return new ProtocolResponse("AuthTokenManager", data.id).Encode(); 25 | } 26 | 27 | public class AuthTokenManagerCloseType 28 | { 29 | public string id { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Auth/AuthTokenManagerGetAuthCompleted.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Auth; 17 | 18 | internal class AuthTokenManagerGetAuthCompleted : ProtocolObject 19 | { 20 | public AuthTokenManagerGetAuthCompletedDto data { get; set; } 21 | 22 | public class AuthTokenManagerGetAuthCompletedDto 23 | { 24 | public string requestId { get; set; } 25 | public AuthorizationToken auth { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Auth/AuthTokenManagerHandleSecurityExceptionCompleted.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Auth; 17 | 18 | internal class AuthTokenManagerHandleSecurityExceptionCompleted : ProtocolObject 19 | { 20 | public AuthTokenManagerHandleSecurityExceptionCompletedDto data { get; set; } 21 | 22 | public class AuthTokenManagerHandleSecurityExceptionCompletedDto 23 | { 24 | public string requestId { get; set; } 25 | public bool handled { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Auth/BasicAuthTokenProviderCompleted.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Auth; 17 | 18 | internal class BasicAuthTokenProviderCompleted : ProtocolObject 19 | { 20 | public BasicAuthTokenProviderCompletedDto data { get; set; } 21 | 22 | public class BasicAuthTokenProviderCompletedDto 23 | { 24 | public string requestId { get; set; } 25 | public AuthorizationToken auth { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Auth/ClientCertificateProviderClose.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Auth; 17 | 18 | internal class ClientCertificateProviderClose : ProtocolObject 19 | { 20 | public ClientCertificateProviderCloseType data { get; set; } = new(); 21 | 22 | public override string Respond() 23 | { 24 | return new ProtocolResponse("ClientCertificateProvider", data.id).Encode(); 25 | } 26 | 27 | public class ClientCertificateProviderCloseType 28 | { 29 | public string id { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Auth/ClientCertificateProviderCompleted.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Auth; 17 | 18 | internal class ClientCertificateProviderCompleted : ProtocolObject 19 | { 20 | public ClientCertificateProviderCompletedDto data { get; set; } = new(); 21 | 22 | public class ClientCertificateProviderCompletedDto 23 | { 24 | public string requestId { get; set; } 25 | public ClientCertificate clientCertificate { get; set; } = new(); 26 | public bool hasUpdate { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Auth/TemporalAuthTokenProviderCompleted.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Auth; 17 | 18 | internal class TemporalAuthTokenProviderCompleted : ProtocolObject 19 | { 20 | public TemporalAuthTokenProviderCompletedDto data { get; set; } 21 | 22 | public class TemporalAuthTokenProviderCompletedDto 23 | { 24 | public string requestId { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/BookmarkManager/BookmarkManagerClose.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.BookmarkManager; 17 | 18 | internal class BookmarkManagerClose : ProtocolObject 19 | { 20 | #pragma warning disable CS0649 // field will only be assigned to during deserialization from JSON message 21 | public BookmarkManagerCloseDto data; 22 | #pragma warning restore CS0649 23 | 24 | public override string Respond() 25 | { 26 | return new ProtocolResponse("BookmarkManager", new { data.id }).Encode(); 27 | } 28 | 29 | public class BookmarkManagerCloseDto 30 | { 31 | public string id { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/BookmarkManager/BookmarkManagerConsumerRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.BookmarkManager; 17 | 18 | internal class BookmarkManagerConsumerRequest : ProtocolObject 19 | { 20 | public BookmarkManagerConsumerRequest(ProtocolObjectManager pom) 21 | { 22 | pom.AddProtocolObject(this); 23 | ObjManager = pom; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/BookmarkManager/BookmarkManagerSupplierRequest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.BookmarkManager; 17 | 18 | internal class BookmarkManagerSupplierRequest : ProtocolObject 19 | { 20 | public BookmarkManagerSupplierRequest(ProtocolObjectManager pom) 21 | { 22 | pom.AddProtocolObject(this); 23 | ObjManager = pom; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/BookmarkManager/BookmarksConsumerCompleted.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.BookmarkManager; 17 | 18 | internal class BookmarksConsumerCompleted : ProtocolObject 19 | { 20 | #pragma warning disable CS0649 // field will only be assigned to during deserialization from JSON message 21 | public BookmarksConsumerCompletedDto data; 22 | #pragma warning restore CS0649 23 | 24 | public class BookmarksConsumerCompletedDto 25 | { 26 | public string requestId { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/BookmarkManager/BookmarksSupplierCompleted.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.BookmarkManager; 17 | 18 | internal class BookmarksSupplierCompleted : ProtocolObject 19 | { 20 | #pragma warning disable CS0649 // field will only be assigned to during deserialization from JSON message 21 | public BookmarksSupplierCompletedDto data; 22 | #pragma warning restore CS0649 23 | 24 | public class BookmarksSupplierCompletedDto 25 | { 26 | public string requestId { get; set; } 27 | public string[] bookmarks { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Driver/DriverClose.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading.Tasks; 17 | 18 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Driver; 19 | 20 | internal class DriverClose : ProtocolObject 21 | { 22 | public DriverCloseType data { get; set; } = new(); 23 | 24 | public override async Task Process() 25 | { 26 | var driver = ((NewDriver)ObjManager.GetObject(data.driverId)).Driver; 27 | await driver.DisposeAsync(); 28 | } 29 | 30 | public override string Respond() 31 | { 32 | return new ProtocolResponse("Driver", uniqueId).Encode(); 33 | } 34 | 35 | public class DriverCloseType 36 | { 37 | public string driverId { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Handshake/GetFeatures.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading.Tasks; 17 | 18 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Handshake; 19 | 20 | internal class GetFeatures : ProtocolObject 21 | { 22 | public GetFeaturesType data { get; set; } = new(); 23 | 24 | public override async Task Process() 25 | { 26 | await Task.CompletedTask; 27 | } 28 | 29 | public override string Respond() 30 | { 31 | return new ProtocolResponse( 32 | "FeatureList", 33 | new 34 | { 35 | features = SupportedFeatures.FeaturesList 36 | }).Encode(); 37 | } 38 | 39 | public class GetFeaturesType 40 | { 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/ProtocolException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Threading.Tasks; 18 | using Newtonsoft.Json; 19 | 20 | namespace Neo4j.Driver.Tests.TestBackend.Protocol; 21 | 22 | internal class ProtocolException : ProtocolObject 23 | { 24 | public ProtocolExceptionType data { get; set; } = new(); 25 | 26 | [JsonIgnore] 27 | public Exception ExceptionObj { get; set; } 28 | 29 | public override async Task Process() 30 | { 31 | await Task.CompletedTask; 32 | } 33 | 34 | public class ProtocolExceptionType 35 | { 36 | public string msg { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/Session/SessionClose.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading.Tasks; 17 | 18 | namespace Neo4j.Driver.Tests.TestBackend.Protocol.Session; 19 | 20 | internal class SessionClose : ProtocolObject 21 | { 22 | public SessionCloseType data { get; set; } = new(); 23 | 24 | public override async Task Process() 25 | { 26 | var session = ((NewSession)ObjManager.GetObject(data.sessionId)).Session; 27 | await session.CloseAsync(); 28 | } 29 | 30 | public override string Respond() 31 | { 32 | return new ProtocolResponse("Session", uniqueId).Encode(); 33 | } 34 | 35 | public class SessionCloseType 36 | { 37 | public string sessionId { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Protocol/TestkitConstants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Tests.TestBackend.Protocol; 17 | 18 | public class TestkitConstants 19 | { 20 | public static class NotificationsConfig 21 | { 22 | public const string Disabled = "OFF"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Internal/MessageHandling/Messages/BoltAgentBuilderTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using FluentAssertions; 17 | using Neo4j.Driver.Internal.Messaging.Utils; 18 | using Xunit; 19 | 20 | namespace Neo4j.Driver.Tests.Internal.MessageHandling.Messages; 21 | 22 | public class BoltAgentBuilderTests 23 | { 24 | [Fact] 25 | public void ShouldReturnBoltAgent() 26 | { 27 | var agent = BoltAgentBuilder.Agent; 28 | agent.Should() 29 | .HaveCount(3) 30 | .And.ContainKey("platform") 31 | .And.ContainKey("language_details") 32 | .And.ContainKey("product") 33 | .WhichValue.Should() 34 | .MatchRegex(@"^neo4j-dotnet/\d\.\d+\.\d+$"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Internal/MessageHandling/Messages/CommitMessageTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using FluentAssertions; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | using Neo4j.Driver.Internal.Messaging; 19 | using Xunit; 20 | 21 | namespace Neo4j.Driver.Tests.Internal.MessageHandling.Messages; 22 | 23 | public class CommitMessageTests 24 | { 25 | [Fact] 26 | public void ShouldHaveCorrectSerializer() 27 | { 28 | CommitMessage.Instance.Serializer.Should().BeOfType(); 29 | } 30 | 31 | [Fact] 32 | public void ShouldHaveMessage() 33 | { 34 | CommitMessage.Instance.ToString().Should().Be("COMMIT"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Internal/MessageHandling/Messages/GoodbyeMessageTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using FluentAssertions; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | using Neo4j.Driver.Internal.Messaging; 19 | using Xunit; 20 | 21 | namespace Neo4j.Driver.Internal.MessageHandling.Messages; 22 | 23 | public class GoodbyeMessageTests 24 | { 25 | [Fact] 26 | public void ShouldHaveCorrectSerializer() 27 | { 28 | GoodbyeMessage.Instance.Serializer.Should().BeOfType(); 29 | } 30 | 31 | [Fact] 32 | public void ShouldIncludeValuesInToString() 33 | { 34 | GoodbyeMessage.Instance.ToString().Should().Be("GOODBYE"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Internal/MessageHandling/Messages/PullAllMessageTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using FluentAssertions; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | using Neo4j.Driver.Internal.Messaging; 19 | using Xunit; 20 | 21 | namespace Neo4j.Driver.Tests.Internal.MessageHandling.Messages; 22 | 23 | public class PullAllMessageTests 24 | { 25 | [Fact] 26 | public void ShouldHaveCorrectSerializer() 27 | { 28 | PullAllMessage.Instance.Serializer.Should().BeOfType(); 29 | } 30 | 31 | [Fact] 32 | public void ShouldHavePullAllMessage() 33 | { 34 | PullAllMessage.Instance.ToString().Should().Be("PULLALL"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Internal/MessageHandling/Messages/ResetMessageTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using FluentAssertions; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | using Neo4j.Driver.Internal.Messaging; 19 | using Xunit; 20 | 21 | namespace Neo4j.Driver.Tests.Internal.MessageHandling.Messages; 22 | 23 | public class ResetMessageTests 24 | { 25 | [Fact] 26 | public void ShouldHaveCorrectSerializer() 27 | { 28 | ResetMessage.Instance.Serializer.Should().BeOfType(); 29 | } 30 | 31 | [Fact] 32 | public void ShouldHaveResetMessage() 33 | { 34 | ResetMessage.Instance.ToString().Should().Be("RESET"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Internal/MessageHandling/Messages/RollbackMessageTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using FluentAssertions; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | using Neo4j.Driver.Internal.Messaging; 19 | using Xunit; 20 | 21 | namespace Neo4j.Driver.Tests.Internal.MessageHandling.Messages; 22 | 23 | public class RollbackMessageTests 24 | { 25 | [Fact] 26 | public void ShouldHaveCorrectSerializer() 27 | { 28 | RollbackMessage.Instance.Serializer.Should().BeOfType(); 29 | } 30 | 31 | [Fact] 32 | public void ShouldHaveRollbackMessage() 33 | { 34 | RollbackMessage.Instance.ToString().Should().Be("ROLLBACK"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Mapping/MappingTestWithGlobalState.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using Neo4j.Driver.Mapping; 18 | using Xunit; 19 | 20 | namespace Neo4j.Driver.Tests.Mapping; 21 | 22 | [CollectionDefinition("UsesMappingGlobalState", DisableParallelization = true)] 23 | public class UsesMappingGlobalState 24 | { 25 | } 26 | 27 | [Collection("UsesMappingGlobalState")] 28 | public class MappingTestWithGlobalState : IDisposable 29 | { 30 | public MappingTestWithGlobalState() 31 | { 32 | RecordObjectMapping.Reset(); 33 | } 34 | 35 | /// 36 | public void Dispose() 37 | { 38 | RecordObjectMapping.Reset(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Neo4j.Driver.Tests.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  4 | 5 | True 7 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Reactive/AbstractRxTest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Microsoft.Reactive.Testing; 17 | using Xunit.Abstractions; 18 | 19 | namespace Neo4j.Driver.Tests.Reactive; 20 | 21 | public abstract class AbstractRxTest : ReactiveTest 22 | { 23 | protected AbstractRxTest() 24 | : this(null) 25 | { 26 | } 27 | 28 | protected AbstractRxTest(ITestOutputHelper output) 29 | { 30 | Output = output; 31 | Scheduler = new TestScheduler(); 32 | } 33 | 34 | protected ITestOutputHelper Output { get; } 35 | protected TestScheduler Scheduler { get; } 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Reactive/Utils/Extensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | using System.Linq; 19 | using System.Reactive; 20 | using System.Reactive.Linq; 21 | using Microsoft.Reactive.Testing; 22 | 23 | namespace Neo4j.Driver.Tests.Reactive.Utils; 24 | 25 | public static class Extensions 26 | { 27 | public static IEnumerable>> WaitForCompletion(this IObservable observable) 28 | { 29 | return observable.Materialize().Select(n => new Recorded>(0, n)).ToEnumerable().ToList(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/Simple/Internal/InternalTransactionTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Moq; 17 | using Neo4j.Driver.Internal; 18 | using Xunit; 19 | 20 | namespace Neo4j.Driver.Tests.Simple.Internal; 21 | 22 | public static class InternalTransactionTests 23 | { 24 | public class TransactionConfig 25 | { 26 | [Fact] 27 | public void ShouldDelegateToAsyncTransaction() 28 | { 29 | var asyncTx = new Mock(); 30 | var tx = new InternalTransaction(asyncTx.Object, Mock.Of()); 31 | 32 | var config = tx.TransactionConfig; 33 | 34 | asyncTx.Verify(x => x.TransactionConfig, Times.Once); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/TestUtil/LoggingHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Moq; 17 | 18 | namespace Neo4j.Driver.Tests.TestUtil; 19 | 20 | public static class LoggingHelper 21 | { 22 | public static Mock GetTraceEnabledLogger() 23 | { 24 | var mockLogger = new Mock(); 25 | mockLogger.Setup(x => x.IsTraceEnabled()).Returns(true); 26 | mockLogger.Setup(x => x.IsDebugEnabled()).Returns(true); 27 | return mockLogger; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/TestUtil/MockExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Collections.Generic; 17 | using Moq.Language; 18 | 19 | namespace Neo4j.Driver.Tests.TestUtil; 20 | 21 | public static class MockExtensions 22 | { 23 | public static ISetupSequentialResult ReturnsSequence( 24 | this ISetupSequentialResult setup, 25 | IEnumerable results) 26 | { 27 | foreach (var result in results) 28 | { 29 | setup.Returns(result); 30 | } 31 | 32 | return setup; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/TestUtil/MockExtensionsTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using FluentAssertions; 17 | using Moq; 18 | using Xunit; 19 | 20 | namespace Neo4j.Driver.Tests.TestUtil; 21 | 22 | public class MockExtensionsTests 23 | { 24 | [Fact] 25 | public void ShouldSetupSequentialReturns() 26 | { 27 | var mock = new Mock(); 28 | mock.SetupSequence(x => x.Value).ReturnsSequence(new[] { 1, 2, 3 }); 29 | 30 | mock.Object.Value.Should().Be(1); 31 | mock.Object.Value.Should().Be(2); 32 | mock.Object.Value.Should().Be(3); 33 | } 34 | 35 | public interface IntGetter 36 | { 37 | int Value { get; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver.Tests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/AcquireStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal; 17 | 18 | internal enum AcquireStatus 19 | { 20 | Healthy, 21 | Unhealthy, 22 | RequiresLivenessProbe 23 | } 24 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Auth/BasicAuthToken.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Auth; 17 | 18 | internal class BasicAuthToken : AuthToken 19 | { 20 | public BasicAuthToken(string username, string password, string realm = null) 21 | { 22 | Content[SchemeKey] = "basic"; 23 | Content[PrincipalKey] = username; 24 | Content[CredentialsKey] = password; 25 | if (realm != null) 26 | { 27 | Content[RealmKey] = realm; 28 | } 29 | } 30 | 31 | /// 32 | public override int GetHashCode() 33 | { 34 | return Content[PrincipalKey].GetHashCode(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Auth/BearerAuthToken.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Internal.Auth; 19 | 20 | internal class BearerAuthToken : AuthToken 21 | { 22 | public BearerAuthToken(string token) 23 | { 24 | if (string.IsNullOrEmpty(token)) 25 | { 26 | throw new ArgumentException("Bearer token cannot be null or an empty string"); 27 | } 28 | 29 | Content[SchemeKey] = "bearer"; 30 | Content[CredentialsKey] = token; 31 | } 32 | 33 | public string Token => Content[CredentialsKey] as string ?? string.Empty; 34 | 35 | public override string ToString() 36 | { 37 | return $"BearerAuthToken{{scheme: {Scheme}, token: {Token.Substring(0, 5)}...}}"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Auth/DelegateTlsNegotiator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.IO; 18 | using System.Net.Security; 19 | 20 | namespace Neo4j.Driver.Internal.Auth; 21 | 22 | internal sealed class DelegateTlsNegotiator : ITlsNegotiator 23 | { 24 | private readonly NegotiateTlsDelegate _negotiateTlsDelegate; 25 | 26 | public DelegateTlsNegotiator(NegotiateTlsDelegate negotiateTlsDelegate) 27 | { 28 | _negotiateTlsDelegate = negotiateTlsDelegate; 29 | } 30 | 31 | public SslStream NegotiateTls(Uri uri, Stream stream) 32 | { 33 | return _negotiateTlsDelegate(uri, stream); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Auth/KerberosAuthToken.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Auth; 17 | 18 | internal class KerberosAuthToken : AuthToken 19 | { 20 | public KerberosAuthToken(string base64EncodedTicket) 21 | { 22 | Content[SchemeKey] = "kerberos"; 23 | Content[PrincipalKey] = string.Empty; // This empty string is required for backwards compatibility. 24 | Content[CredentialsKey] = base64EncodedTicket; 25 | } 26 | 27 | public string Ticket => Content[CredentialsKey] as string; 28 | 29 | public override string ToString() 30 | { 31 | return $"KerberosAuthToken[scheme: {Scheme}, ticket: {Ticket.Substring(0, 5)}...]"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Auth/StaticClientCertificateProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Security.Cryptography.X509Certificates; 17 | using System.Threading.Tasks; 18 | 19 | namespace Neo4j.Driver.Internal.Auth; 20 | 21 | internal class StaticClientCertificateProvider : IClientCertificateProvider 22 | { 23 | private readonly X509Certificate _certificate; 24 | 25 | public StaticClientCertificateProvider(X509Certificate certificate) 26 | { 27 | _certificate = certificate; 28 | } 29 | 30 | public ValueTask GetCertificateAsync() 31 | { 32 | return new ValueTask(_certificate); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/BookmarkManagerFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal; 17 | 18 | internal class BookmarkManagerFactory : IBookmarkManagerFactory 19 | { 20 | public IBookmarkManager NewBookmarkManager(BookmarkManagerConfig config = null) 21 | { 22 | return new DefaultBookmarkManager(config ?? new BookmarkManagerConfig()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/ConnectionPoolStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal; 17 | 18 | internal sealed class ConnectionPoolStatus 19 | { 20 | public static readonly ConnectionPoolStatus Active = new(PoolStatus.Open); 21 | public static readonly ConnectionPoolStatus Closed = new(PoolStatus.Closed); 22 | public static readonly ConnectionPoolStatus Inactive = new(PoolStatus.Inactive); 23 | 24 | private readonly PoolStatus _code; 25 | 26 | private ConnectionPoolStatus(PoolStatus code) 27 | { 28 | _code = code; 29 | } 30 | 31 | public override string ToString() 32 | { 33 | return $"{nameof(ConnectionPoolStatus)} {{{_code}}}"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Connector/ByteBuffers.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Connector; 17 | 18 | internal sealed class ByteBuffers 19 | { 20 | public byte[] ByteArray = new byte[1]; 21 | public byte[] IntBuffer = new byte[4]; 22 | public byte[] LongBuffer = new byte[8]; 23 | public byte[] ShortBuffer = new byte[2]; 24 | } 25 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Connector/IHostResolver.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Net; 17 | using System.Threading.Tasks; 18 | 19 | namespace Neo4j.Driver.Internal.Connector; 20 | 21 | internal interface IHostResolver 22 | { 23 | IPAddress[] Resolve(string hostname); 24 | Task ResolveAsync(string hostname); 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Connector/IMessageWriter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading.Tasks; 17 | using Neo4j.Driver.Internal.IO; 18 | using Neo4j.Driver.Internal.Messaging; 19 | 20 | namespace Neo4j.Driver.Internal.Connector; 21 | 22 | internal interface IMessageWriter 23 | { 24 | void Write(IRequestMessage message, PackStreamWriter writer); 25 | Task FlushAsync(); 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Connector/ITcpSocketClient.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.IO; 18 | using System.Threading; 19 | using System.Threading.Tasks; 20 | 21 | namespace Neo4j.Driver.Internal.Connector; 22 | 23 | internal interface ITcpSocketClient : IDisposable 24 | { 25 | Stream ReaderStream { get; } 26 | Stream WriterStream { get; } 27 | Task ConnectAsync(Uri uri, CancellationToken cancellationToken = default); 28 | 29 | Uri ConnectionUri { get; } 30 | } 31 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Connector/Resolvers/SystemHostResolver.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Net; 17 | using System.Threading.Tasks; 18 | 19 | namespace Neo4j.Driver.Internal.Connector.Resolvers; 20 | 21 | internal class SystemHostResolver : IHostResolver 22 | { 23 | public IPAddress[] Resolve(string hostname) 24 | { 25 | return Dns.GetHostAddressesAsync(hostname).GetAwaiter().GetResult(); 26 | } 27 | 28 | public Task ResolveAsync(string hostname) 29 | { 30 | return Dns.GetHostAddressesAsync(hostname); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/ExecuteQuery/IQueryRowSource.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Threading; 18 | using System.Threading.Tasks; 19 | 20 | namespace Neo4j.Driver.Internal; 21 | 22 | internal record ExecutionSummary(IResultSummary Summary, string[] Keys); 23 | 24 | internal interface IQueryRowSource 25 | { 26 | Task GetRowsAsync(Action rowProcessor, CancellationToken cancellationToken = default); 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/ExecuteQuery/ReduceToList.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Collections.Generic; 17 | 18 | namespace Neo4j.Driver.Internal; 19 | 20 | internal static class ReduceToList 21 | { 22 | public static List Seed() 23 | { 24 | return new List(); 25 | } 26 | 27 | public static List Accumulate(List list, T item) 28 | { 29 | list.Add(item); 30 | return list; 31 | } 32 | 33 | public static IReadOnlyList SelectResult(List accumulation) 34 | { 35 | return accumulation; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Extensions/ConnectionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.Connector; 17 | using Neo4j.Driver.Internal.Protocol; 18 | 19 | namespace Neo4j.Driver.Internal; 20 | 21 | internal static class ConnectionExtensions 22 | { 23 | public static bool SupportsMultiDatabase(this IConnection connection) 24 | { 25 | return connection.Version >= BoltProtocolVersion.V4_0; 26 | } 27 | 28 | public static bool SupportsReAuth(this IConnection connection) 29 | { 30 | return connection.Version >= BoltProtocolVersion.V5_1; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Extensions/TypeExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Internal; 19 | 20 | internal static class TypeExtensions 21 | { 22 | public static T CastOrThrow(this object value) 23 | { 24 | if (value is not T result) 25 | { 26 | throw new ArgumentOutOfRangeException( 27 | $"Encountered {value?.GetType().Name} where {typeof(T).Name} was expected"); 28 | } 29 | 30 | return result; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Extensions/UtilityExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Collections.Generic; 17 | 18 | namespace Neo4j.Driver.Internal; 19 | 20 | /// A collection of miscellaneous utility extensions. 21 | internal static class UtilityExtensions 22 | { 23 | public static void Deconstruct(this KeyValuePair kvp, out TKey key, out TValue value) 24 | { 25 | key = kvp.Key; 26 | value = kvp.Value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Helpers/RuntimeHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Runtime.InteropServices; 18 | 19 | namespace Neo4j.Driver.Internal.Helpers; 20 | 21 | internal static class RuntimeHelper 22 | { 23 | static RuntimeHelper() 24 | { 25 | var frameworkDescription = RuntimeInformation.FrameworkDescription; 26 | var mono = frameworkDescription.StartsWith("mono", StringComparison.OrdinalIgnoreCase); 27 | var framework = frameworkDescription.StartsWith(".net framework", StringComparison.OrdinalIgnoreCase); 28 | IsDotNetCore = !mono && !framework; 29 | } 30 | 31 | public static bool IsDotNetCore { get; } 32 | } 33 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Helpers/UniqueIdGenerator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading; 17 | 18 | namespace Neo4j.Driver.Internal.Helpers; 19 | 20 | internal static class UniqueIdGenerator 21 | { 22 | private static long _count; 23 | 24 | public static long GetId() 25 | { 26 | return Interlocked.Increment(ref _count); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/HomeDbCaching/IHomeDbCache.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.HomeDbCaching; 17 | 18 | internal interface IHomeDbCache 19 | { 20 | bool TryGetCached(HomeDbCacheKey key, out string value); 21 | void AddOrUpdate(HomeDbCacheKey key, string value); 22 | } 23 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IConnectionPool.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading.Tasks; 17 | using Neo4j.Driver.Internal.Connector; 18 | 19 | namespace Neo4j.Driver.Internal; 20 | 21 | internal interface IConnectionPool : IConnectionProvider, IConnectionReleaseManager 22 | { 23 | int NumberOfInUseConnections { get; } 24 | int NumberOfIdleConnections { get; } 25 | int NumberOfConnectionsWithSsrEnabled { get; } 26 | int NumberOfConnectionsWithSsrDisabled { get; } 27 | 28 | int TotalNumberOfConnections { get; } 29 | ConnectionPoolStatus Status { get; } 30 | Task DeactivateAsync(); 31 | void Activate(); 32 | 33 | bool IsOnlyConnectionWithoutSsr(IConnection connection); 34 | } 35 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IConnectionReleaseManager.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Threading.Tasks; 18 | 19 | namespace Neo4j.Driver.Internal; 20 | 21 | internal interface IConnectionReleaseManager 22 | { 23 | Task ReleaseAsync(IPooledConnection connection); 24 | void OnPoolMemberException(IPooledConnection connection, Exception exception); 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IInternalAsyncTransaction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Internal; 19 | 20 | internal interface IInternalAsyncTransaction : IAsyncTransaction 21 | { 22 | bool IsOpen { get; } 23 | bool IsErrored(out Exception ex); 24 | } 25 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IInternalResultCursor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal; 17 | 18 | internal interface IInternalResultCursor : IResultCursor 19 | { 20 | void Cancel(); 21 | } 22 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IO/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.IO; 17 | 18 | internal static class Constants 19 | { 20 | public const int MaxChunkSize = ushort.MaxValue; 21 | public const int MinChunkSize = 6; 22 | 23 | public const int ChunkBufferSize = 16 * 1024; 24 | public const int ChunkBufferResetPositionsWatermark = 1024; 25 | public const int DefaultReadBufferSize = 32 * 1024; 26 | public const int MaxReadBufferSize = 128 * 1024; 27 | public const int DefaultWriteBufferSize = 16 * 1024; 28 | public const int MaxWriteBufferSize = 64 * 1024; 29 | public const int DefaultFetchSize = 1000; 30 | } 31 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IO/IChunkReader.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.IO; 17 | using System.Threading.Tasks; 18 | 19 | namespace Neo4j.Driver.Internal.IO; 20 | 21 | internal interface IChunkReader 22 | { 23 | Task ReadMessageChunksToBufferStreamAsync(Stream bufferStream); 24 | void SetTimeoutInMs(int ms); 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IO/IMessageReader.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Threading.Tasks; 18 | using Neo4j.Driver.Internal.MessageHandling; 19 | using Neo4j.Driver.Internal.Protocol; 20 | 21 | namespace Neo4j.Driver.Internal.IO; 22 | 23 | internal interface IMessageReader : IAsyncDisposable 24 | { 25 | ValueTask ReadAsync(IResponsePipeline pipeline, MessageFormat format); 26 | void SetReadTimeoutInMs(int ms); 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IO/IPackStreamSerializer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | using Neo4j.Driver.Internal.Protocol; 19 | 20 | namespace Neo4j.Driver.Internal.IO; 21 | 22 | internal interface IPackStreamSerializer 23 | { 24 | byte[] ReadableStructs { get; } 25 | 26 | IEnumerable WritableTypes { get; } 27 | 28 | object Deserialize(BoltProtocolVersion version, PackStreamReader reader, byte signature, long size); 29 | void Serialize(BoltProtocolVersion version, PackStreamWriter writer, object value); 30 | (object, int) DeserializeSpan(BoltProtocolVersion version, SpanPackStreamReader reader, byte signature, int size); 31 | } 32 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IO/PackStreamFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.Protocol; 17 | 18 | namespace Neo4j.Driver.Internal.IO; 19 | 20 | internal interface IPackStreamFactory 21 | { 22 | PackStreamWriter BuildWriter(MessageFormat format, IChunkWriter stream); 23 | } 24 | 25 | internal sealed class PackStreamFactory : IPackStreamFactory 26 | { 27 | internal static readonly PackStreamFactory Default = new(); 28 | 29 | private PackStreamFactory() 30 | { 31 | } 32 | 33 | public PackStreamWriter BuildWriter(MessageFormat format, IChunkWriter stream) 34 | { 35 | return new PackStreamWriter(format, stream.Stream); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IO/PackStreamType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.IO; 17 | 18 | internal enum PackStreamType 19 | { 20 | Null, 21 | Boolean, 22 | Integer, 23 | Float, 24 | Bytes, 25 | String, 26 | List, 27 | Map, 28 | Struct 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/IO/ValueSerializers/Temporal/SystemDateTimeOffsetSerializer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | 19 | namespace Neo4j.Driver.Internal.IO.ValueSerializers.Temporal; 20 | 21 | internal sealed class SystemDateTimeOffsetSerializer : WriteOnlySerializer 22 | { 23 | internal static readonly SystemDateTimeOffsetSerializer Instance = new(); 24 | 25 | public override IEnumerable WritableTypes => new[] { typeof(DateTimeOffset) }; 26 | 27 | public override void Serialize(PackStreamWriter writer, object value) 28 | { 29 | var dateTime = value.CastOrThrow(); 30 | 31 | writer.Write(new ZonedDateTime(dateTime)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Logging/PrefixLogger.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Logging; 17 | 18 | internal class PrefixLogger : ReformattedLogger 19 | { 20 | public PrefixLogger(ILogger logger, string prefix = null) : base(logger) 21 | { 22 | Prefix = prefix; 23 | } 24 | 25 | public string Prefix { private get; set; } 26 | 27 | protected override string Reformat(string message) 28 | { 29 | return Prefix == null ? message : $"{Prefix} {message}"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Mapping/ConventionTranslation/NoOpConventionTranslator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Mapping.ConventionTranslation; 17 | 18 | namespace Neo4j.Driver.Internal.Mapping.ConventionTranslation; 19 | 20 | public class NoOpConventionTranslator : IConventionTranslator 21 | { 22 | /// 23 | public string Translate(string input) 24 | { 25 | return input; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Mapping/DelegateMapper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Reflection; 17 | 18 | namespace Neo4j.Driver.Internal.Mapping; 19 | 20 | internal class DelegateMapper 21 | { 22 | private static readonly IParameterMapper ParameterMapper = new ParameterMapper(); 23 | 24 | internal static T MapWithMethodInfo(IRecord record, MethodInfo mapFunction, object target) 25 | { 26 | var mapMethod = ParameterMapper.GetParameterMappedCall(mapFunction, target); 27 | return mapMethod(record); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Mapping/TypeConversion/IMappingTypeConversionManager.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Internal.Mapping.TypeConversion; 19 | 20 | internal interface IMappingTypeConversionManager 21 | { 22 | bool TryConvert(TFrom from, out TTo to); 23 | void RegisterConverter(Func converter); 24 | bool TryConvert(Type fromType, Type toType, object from, out object to); 25 | void Clear(); 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/MessageHandling/IBookmarksTracker.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.MessageHandling; 17 | 18 | internal interface IBookmarksTracker 19 | { 20 | void UpdateBookmarks(Bookmarks bookmarks, IDatabaseInfo dbInfo = null); 21 | } 22 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/MessageHandling/IMetadataCollector.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Collections.Generic; 17 | 18 | namespace Neo4j.Driver.Internal.MessageHandling; 19 | 20 | internal interface IMetadataCollector 21 | { 22 | object Collected { get; } 23 | 24 | void Collect(IDictionary metadata); 25 | } 26 | 27 | internal interface IMetadataCollector : IMetadataCollector 28 | { 29 | new TMetadata Collected { get; } 30 | } 31 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/MessageHandling/IResponseHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Collections.Generic; 17 | 18 | namespace Neo4j.Driver.Internal.MessageHandling; 19 | 20 | internal interface IResponseHandler 21 | { 22 | void OnSuccess(IDictionary metadata); 23 | 24 | void OnRecord(object[] fieldValues); 25 | 26 | void OnFailure(IResponsePipelineError error); 27 | 28 | void OnIgnored(); 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/MessageHandling/IResponsePipeline.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | using Neo4j.Driver.Internal.Messaging; 19 | 20 | namespace Neo4j.Driver.Internal.MessageHandling; 21 | 22 | internal interface IResponsePipeline 23 | { 24 | bool HasNoPendingMessages { get; } 25 | bool IsHealthy(out Exception error); 26 | void Enqueue(IResponseHandler handler); 27 | void OnSuccess(IDictionary metadata); 28 | void OnRecord(object[] fieldValues); 29 | void OnFailure(FailureMessage failureMessage); 30 | void OnIgnored(); 31 | void AssertNoFailure(); 32 | void AssertNoProtocolViolation(); 33 | } 34 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/MessageHandling/IResponsePipelineError.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Internal.MessageHandling; 19 | 20 | internal interface IResponsePipelineError 21 | { 22 | Exception Exception { get; } 23 | void EnsureThrown(); 24 | void EnsureThrownIf(); 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/CommitMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | 19 | namespace Neo4j.Driver.Internal.Messaging; 20 | 21 | internal sealed class CommitMessage : IRequestMessage 22 | { 23 | public static readonly CommitMessage Instance = new(); 24 | 25 | private CommitMessage() 26 | { 27 | } 28 | 29 | public IPackStreamSerializer Serializer => CommitMessageSerializer.Instance; 30 | 31 | public override string ToString() 32 | { 33 | return "COMMIT"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/DiscardMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | 19 | namespace Neo4j.Driver.Internal.Messaging; 20 | 21 | internal sealed class DiscardMessage : ResultHandleMessage 22 | { 23 | public DiscardMessage(long n) 24 | : this(NoQueryId, n) 25 | { 26 | } 27 | 28 | public DiscardMessage(long id, long n) 29 | : base(id, n) 30 | { 31 | } 32 | 33 | protected override string Name => "DISCARD"; 34 | 35 | public override IPackStreamSerializer Serializer => DiscardMessageSerializer.Instance; 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/GoodbyeMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | 19 | namespace Neo4j.Driver.Internal.Messaging; 20 | 21 | internal sealed class GoodbyeMessage : IRequestMessage 22 | { 23 | public static readonly GoodbyeMessage Instance = new(); 24 | 25 | private GoodbyeMessage() 26 | { 27 | } 28 | 29 | public IPackStreamSerializer Serializer => GoodbyeMessageSerializer.Instance; 30 | 31 | public override string ToString() 32 | { 33 | return "GOODBYE"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/IMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.MessageHandling; 18 | 19 | namespace Neo4j.Driver.Internal.Messaging; 20 | 21 | internal interface IRequestMessage : IMessage 22 | { 23 | } 24 | 25 | internal interface IResponseMessage : IMessage 26 | { 27 | void Dispatch(IResponsePipeline pipeline); 28 | } 29 | 30 | internal interface IMessage 31 | { 32 | IPackStreamSerializer Serializer { get; } 33 | } 34 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/LogoffMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | 19 | namespace Neo4j.Driver.Internal.Messaging; 20 | 21 | internal sealed class LogoffMessage : IRequestMessage 22 | { 23 | public static readonly LogoffMessage Instance = new(); 24 | 25 | private LogoffMessage() 26 | { 27 | } 28 | 29 | public IPackStreamSerializer Serializer => LogoffMessageSerializer.Instance; 30 | 31 | public override string ToString() 32 | { 33 | return "LOGOFF"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/PullAllMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | 19 | namespace Neo4j.Driver.Internal.Messaging; 20 | 21 | internal sealed class PullAllMessage : IRequestMessage 22 | { 23 | public static readonly PullAllMessage Instance = new(); 24 | 25 | private PullAllMessage() 26 | { 27 | } 28 | 29 | public IPackStreamSerializer Serializer => PullAllMessageSerializer.Instance; 30 | 31 | public override string ToString() 32 | { 33 | return "PULLALL"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/PullMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | 19 | namespace Neo4j.Driver.Internal.Messaging; 20 | 21 | internal sealed class PullMessage : ResultHandleMessage 22 | { 23 | public PullMessage(long n) 24 | : this(NoQueryId, n) 25 | { 26 | } 27 | 28 | public PullMessage(long id, long n) 29 | : base(id, n) 30 | { 31 | } 32 | 33 | protected override string Name => "PULL"; 34 | 35 | public override IPackStreamSerializer Serializer => PullMessageSerializer.Instance; 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/ResetMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | 19 | namespace Neo4j.Driver.Internal.Messaging; 20 | 21 | internal sealed class ResetMessage : IRequestMessage 22 | { 23 | public static readonly ResetMessage Instance = new(); 24 | 25 | private ResetMessage() 26 | { 27 | } 28 | 29 | public IPackStreamSerializer Serializer => ResetMessageSerializer.Instance; 30 | 31 | public override string ToString() 32 | { 33 | return "RESET"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/RollbackMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | 19 | namespace Neo4j.Driver.Internal.Messaging; 20 | 21 | internal sealed class RollbackMessage : IRequestMessage 22 | { 23 | public static readonly RollbackMessage Instance = new(); 24 | 25 | private RollbackMessage() 26 | { 27 | } 28 | 29 | public IPackStreamSerializer Serializer => RollbackMessageSerializer.Instance; 30 | 31 | public override string ToString() 32 | { 33 | return "ROLLBACK"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Messaging/TelemetryMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.IO; 17 | using Neo4j.Driver.Internal.IO.MessageSerializers; 18 | using Neo4j.Driver.Internal.Telemetry; 19 | 20 | namespace Neo4j.Driver.Internal.Messaging; 21 | 22 | internal class TelemetryMessage : IRequestMessage 23 | { 24 | public TelemetryMessage(QueryApiType apiType) 25 | { 26 | Api = apiType; 27 | } 28 | 29 | public QueryApiType Api { get; } 30 | 31 | public IPackStreamSerializer Serializer => TelemetryMessageSerializer.Instance; 32 | 33 | public override string ToString() 34 | { 35 | return $"TELEMETRY {(int)Api} ({Api})"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Metrics/IConnectionPoolListener.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Internal.Metrics; 19 | 20 | internal interface IConnectionPoolListener : IDisposable 21 | { 22 | void ConnectionCreating(); 23 | void ConnectionCreated(); 24 | void ConnectionFailedToCreate(); 25 | void ConnectionClosing(); 26 | void ConnectionClosed(); 27 | void PoolAcquiring(); 28 | void PoolAcquired(); 29 | void PoolFailedToAcquire(); 30 | void PoolTimedOutToAcquire(); 31 | } 32 | 33 | internal interface IInternalConnectionPoolMetrics : IConnectionPoolMetrics, IConnectionPoolListener 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/PassthroughServerAddressResolver.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Collections.Generic; 17 | 18 | namespace Neo4j.Driver.Internal; 19 | 20 | // simply pass through the server address as it is in the return resolved address set. 21 | internal class PassThroughServerAddressResolver : IServerAddressResolver 22 | { 23 | public ISet Resolve(ServerAddress address) 24 | { 25 | return new HashSet { address }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/PoolStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal; 17 | 18 | internal enum PoolStatus 19 | { 20 | Open, 21 | Closed, 22 | Inactive 23 | } 24 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Protocol/Utility/BookmarksTracker.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Linq; 17 | using Neo4j.Driver.Internal.MessageHandling; 18 | 19 | namespace Neo4j.Driver.Internal.Protocol.Utility; 20 | 21 | internal sealed class BookmarksTracker : IBookmarksTracker 22 | { 23 | public BookmarksTracker(Bookmarks bookmarks) 24 | { 25 | InternalBookmarks = bookmarks; 26 | } 27 | 28 | private Bookmarks InternalBookmarks { get; set; } 29 | 30 | public void UpdateBookmarks(Bookmarks bookmarks, IDatabaseInfo dbInfo = null) 31 | { 32 | if (InternalBookmarks != null && InternalBookmarks.Values.Any()) 33 | { 34 | InternalBookmarks = bookmarks; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Protocol/Utility/ConnectionResourceHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading.Tasks; 17 | using Neo4j.Driver.Internal.Connector; 18 | 19 | namespace Neo4j.Driver.Internal.Protocol.Utility; 20 | 21 | internal sealed class ConnectionResourceHandler : IResultResourceHandler 22 | { 23 | private readonly IConnection _connection; 24 | 25 | public ConnectionResourceHandler(IConnection conn) 26 | { 27 | _connection = conn; 28 | } 29 | 30 | public Task OnResultConsumedAsync() 31 | { 32 | return Task.CompletedTask; 33 | } 34 | 35 | public override string ToString() 36 | { 37 | return $"{nameof(ConnectionResourceHandler)} {{{_connection}}}"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Result/IResultStream.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading.Tasks; 17 | 18 | namespace Neo4j.Driver.Internal.Result; 19 | 20 | internal interface IResultStream 21 | { 22 | ValueTask GetKeysAsync(); 23 | ValueTask NextRecordAsync(); 24 | void Cancel(); 25 | ValueTask ConsumeAsync(); 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Result/IResultStreamBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.MessageHandling; 17 | 18 | namespace Neo4j.Driver.Internal.Result; 19 | 20 | internal interface IResultStreamBuilder 21 | { 22 | void RunCompleted(long queryId, string[] fields, IResponsePipelineError error); 23 | 24 | void PullCompleted(bool hasMore, IResponsePipelineError error); 25 | 26 | void PushRecord(object[] fieldValues); 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Result/Summary/CursorMetadata.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Result; 17 | 18 | /// A simple value holder for metadata about a cursor. 19 | internal record struct CursorMetadata(bool ResultHadRecords, bool ResultHadKeys) 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Result/Summary/IUpdateableInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.Protocol; 17 | 18 | namespace Neo4j.Driver.Internal.Result; 19 | 20 | internal interface IUpdateableInfo 21 | { 22 | void Update(BoltProtocolVersion boltVersion, string agent); 23 | } 24 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Routing/IClusterConnectionPoolManager.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | using System.Threading.Tasks; 19 | using Neo4j.Driver.Internal.Connector; 20 | 21 | namespace Neo4j.Driver.Internal.Routing; 22 | 23 | internal interface IClusterConnectionPoolManager 24 | { 25 | Task AddConnectionPoolAsync(IEnumerable uris); 26 | Task UpdateConnectionPoolAsync(IEnumerable added, IEnumerable removed); 27 | Task CreateClusterConnectionAsync(Uri uri, SessionConfig sessionConfig); 28 | } 29 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Routing/IDiscovery.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Threading.Tasks; 17 | using Neo4j.Driver.Internal.Connector; 18 | using Neo4j.Driver.Internal.HomeDbCaching; 19 | 20 | namespace Neo4j.Driver.Internal.Routing; 21 | 22 | internal interface IDiscovery 23 | { 24 | Task DiscoverAsync( 25 | IConnection connection, 26 | string database, 27 | SessionConfig sessionConfig, 28 | Bookmarks bookmarks, 29 | IHomeDbCache homeDbCache); 30 | } 31 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Routing/IErrorHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Threading.Tasks; 18 | 19 | namespace Neo4j.Driver.Internal.Routing; 20 | 21 | internal interface IErrorHandler 22 | { 23 | Task OnConnectionErrorAsync(Uri uri, string database, Exception e); 24 | void OnWriteError(Uri uri, string database); 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Routing/ILoadBalancingStrategy.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | 19 | namespace Neo4j.Driver.Internal.Routing; 20 | 21 | internal interface ILoadBalancingStrategy 22 | { 23 | Uri SelectReader(IList knownReaders, string forDatabase, string cachedDatabase = null); 24 | Uri SelectWriter(IList knownWriters, string forDatabase, string cachedDatabase = null); 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Routing/IRoutingTable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | 19 | namespace Neo4j.Driver.Internal.Routing; 20 | 21 | internal interface IRoutingTable 22 | { 23 | string Database { get; } 24 | IList Readers { get; } 25 | IList Writers { get; } 26 | IList Routers { get; } 27 | long ExpireAfterSeconds { get; } 28 | 29 | IEnumerable All(); 30 | bool IsStale(AccessMode mode); 31 | bool IsExpiredFor(TimeSpan duration); 32 | void Remove(Uri uri); 33 | void RemoveWriter(Uri uri); 34 | void PrependRouters(IEnumerable uris); 35 | bool IsReadingInAbsenceOfWriter(AccessMode mode); 36 | } 37 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Routing/IRoutingTableManager.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Threading.Tasks; 18 | 19 | namespace Neo4j.Driver.Internal.Routing; 20 | 21 | internal interface IRoutingTableManager 22 | { 23 | Task EnsureRoutingTableForModeAsync( 24 | AccessMode mode, 25 | string database, 26 | bool isCachedHomeDb, 27 | SessionConfig sessionConfig, 28 | Bookmarks bookmark); 29 | 30 | Task GetServerInfoAsync(Uri uri, string database); 31 | void Clear(); 32 | void ForgetServer(Uri uri, string database); 33 | void ForgetWriter(Uri uri, string database); 34 | IRoutingTable RoutingTableFor(string database); 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Telemetry/QueryApiType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Telemetry; 17 | 18 | internal enum QueryApiType 19 | { 20 | TransactionFunction = 0, 21 | UnmanagedTransaction = 1, 22 | AutoCommit = 2, 23 | DriverLevel = 3 24 | } 25 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Types/IHasDateComponents.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Types; 17 | 18 | internal interface IHasDateComponents 19 | { 20 | int Year { get; } 21 | 22 | int Month { get; } 23 | 24 | int Day { get; } 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Types/IHasDateTimeComponents.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Types; 17 | 18 | internal interface IHasDateTimeComponents : IHasDateComponents, IHasTimeComponents 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Types/IHasTimeComponents.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Types; 17 | 18 | internal interface IHasTimeComponents 19 | { 20 | int Hour { get; } 21 | 22 | int Minute { get; } 23 | 24 | int Second { get; } 25 | 26 | int Nanosecond { get; } 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Types/IValue.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Types; 17 | 18 | internal interface IValue 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Types/NotificationConfig.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Collections.Generic; 17 | 18 | namespace Neo4j.Driver.Internal.Types; 19 | 20 | internal sealed class NotificationsConfig : INotificationsConfig 21 | { 22 | public NotificationsConfig(Severity? minimumSeverity, Category[] disabledCategories) 23 | { 24 | MinimumSeverity = minimumSeverity; 25 | 26 | if (disabledCategories != null) 27 | { 28 | DisabledCategories = new HashSet(disabledCategories); 29 | } 30 | } 31 | 32 | public Severity? MinimumSeverity { get; set; } 33 | public HashSet DisabledCategories { get; set; } 34 | } 35 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Types/NotificationsDisabledConfig.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Types; 17 | 18 | internal sealed class NotificationsDisabledConfig : INotificationsConfig 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Util/ConfigBuilders.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Internal.Util; 19 | 20 | internal static class ConfigBuilders 21 | { 22 | public static SessionConfig BuildSessionConfig(Action action) 23 | { 24 | SessionConfig config; 25 | if (action == null) 26 | { 27 | config = SessionConfig.Default; 28 | } 29 | else 30 | { 31 | var builder = SessionConfig.Builder; 32 | action.Invoke(builder); 33 | config = builder.Build(); 34 | } 35 | 36 | return config; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Util/ConnectionContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Internal.Util; 17 | 18 | internal class ConnectionContext 19 | { 20 | /// This describes a read connection with default database. 21 | internal static readonly ConnectionContext Simple = new() 22 | { 23 | Mode = AccessMode.Read, 24 | Database = null, 25 | Bookmarks = Bookmarks.Empty 26 | }; 27 | 28 | public AccessMode Mode { get; private set; } 29 | public string Database { get; private set; } 30 | public Bookmarks Bookmarks { get; private set; } 31 | } 32 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Internal/Util/VarLong.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Internal.Util; 19 | 20 | public class VarLong 21 | { 22 | public long Value { get; private set; } 23 | private byte _position = 0; 24 | private const string ExceptionMessage = "VarLong Segment overflow"; 25 | 26 | public void AddSegment(byte segment) 27 | { 28 | if (_position > 7) 29 | { 30 | throw new ArgumentException(ExceptionMessage); 31 | } 32 | 33 | segment &= 0x7F; 34 | var shiftedSegment = (long)(segment << (_position * 7)); 35 | Value |= shiftedSegment; 36 | _position++; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/AccessMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// Used by driver to route a cypher query to a write server or a read server. 19 | public enum AccessMode 20 | { 21 | /// Requires cypher query to be carried out on a read server 22 | Read, 23 | 24 | /// Requires cypher query to be executed on a write server 25 | Write 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Auth/IAuthToken.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// 19 | /// An authentication token is used to authenticate with a Neo4j instance. It usually contains a Principal, 20 | /// for instance a username, and one or more Credentials, for instance a password. See for 21 | /// available types of s. 22 | /// 23 | /// 24 | /// 25 | /// 26 | public interface IAuthToken 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/CertificateTrustRule.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// Rules for how to validate a server certificate. 19 | public enum CertificateTrustRule 20 | { 21 | /// Trust only certificates that can build a chain against system's CA stores 22 | TrustSystem = 0, 23 | 24 | /// Trust certificates that can build an x509Chain against list of specified certificates. 25 | TrustList = 1, 26 | 27 | /// Trust any certificate 28 | TrustAny = 2 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/EncryptionLevel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// Control the level of encryption to require. 19 | public enum EncryptionLevel 20 | { 21 | /// No encryption at all. 22 | None, 23 | 24 | /// Always encrypted. 25 | Encrypted 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/IsExternalInit.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | // ReSharper disable once CheckNamespace 17 | 18 | namespace System.Runtime.CompilerServices; 19 | 20 | /// adds init and record types. 21 | public class IsExternalInit 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Mapping/ConventionTranslation/IConventionTranslator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Mapping.ConventionTranslation; 17 | 18 | /// 19 | /// Translates a string from one naming convention to another. 20 | /// 21 | public interface IConventionTranslator 22 | { 23 | /// 24 | /// Translate the input string from one naming convention to another. 25 | /// 26 | /// The string to translate. 27 | /// The translated string. 28 | public string Translate(string input); 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Mapping/ConventionTranslation/IFieldFormatter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Mapping.ConventionTranslation; 17 | 18 | /// 19 | /// Formats data into a string that can be used to identify a field. 20 | /// 21 | public interface IFieldFormatter 22 | { 23 | /// 24 | /// Format the data into a string that can be used to identify a field. 25 | /// 26 | /// 27 | /// 28 | public string Format(T data); 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Mapping/ConventionTranslation/IIdentifierParser.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System.Collections.Generic; 17 | 18 | namespace Neo4j.Driver.Mapping.ConventionTranslation; 19 | 20 | /// 21 | /// Extracts tokens from a string. A token is a part of a string that is separated by either a 22 | /// delimiter or a change in case. 23 | /// 24 | public interface IIdentifierParser 25 | { 26 | /// 27 | /// Parse the input string into data that can then be used to create a string in the 28 | /// desired format. 29 | /// 30 | /// The string to parse. 31 | /// The parsed data. 32 | public T ParseIdentifier(string input); 33 | } 34 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Mapping/EntityExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Neo4j.Driver.Internal.Mapping; 17 | 18 | namespace Neo4j.Driver.Mapping; 19 | 20 | /// Contains extensions for entities such as nodes and relationships. 21 | public static class EntityExtensions 22 | { 23 | /// Converts the entity to a record. 24 | /// The entity to convert. 25 | /// The record. 26 | public static IRecord AsRecord(this IEntity entity) 27 | { 28 | return new DictAsRecord(entity, null); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Mapping/IMappingProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Mapping; 17 | 18 | /// Interface to be implemented by a class that provides mappers to the mapping system. 19 | public interface IMappingProvider 20 | { 21 | /// This method is called on mapping providers to allow them to register their mappers with the mapping system. 22 | /// The registry in which mappers should be registered. 23 | void CreateMappers(IMappingRegistry registry); 24 | } 25 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Mapping/IRecordMapper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver.Mapping; 17 | 18 | /// Interface to be implemented by a class that maps records to objects of type . 19 | /// The type of object to which records will be mapped. 20 | public interface IRecordMapper 21 | { 22 | /// Maps the given record to an object of type . 23 | /// The record to map. 24 | /// The mapped object. 25 | T Map(IRecord record); 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Mapping/MappingConstructorAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Mapping; 19 | 20 | /// Indicates that the constructor should be used when mapping a record to an object. 21 | [AttributeUsage(AttributeTargets.Constructor)] 22 | public class MappingConstructorAttribute : Attribute 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Mapping/MappingIgnoredAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | 18 | namespace Neo4j.Driver.Mapping; 19 | 20 | /// 21 | /// Instructs the default object mapper not to attempt to map any value to this property. This attribute does not 22 | /// affect custom-defined mappers. 23 | /// 24 | [AttributeUsage(AttributeTargets.Property)] 25 | public class MappingIgnoredAttribute : Attribute 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/RoutingControl.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// 19 | /// Used for specifying which members of a neo4j cluster will process the workload.
default: 20 | /// 21 | ///
22 | public enum RoutingControl 23 | { 24 | /// Send work to member of cluster that is capable of processing read and write workloads. 25 | Writers = 0, 26 | 27 | /// Send work to a member of cluster capable of processing read workloads. 28 | Readers = 1 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Summary/IDatabaseInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// Provides information about the database that processed the query. 19 | public interface IDatabaseInfo 20 | { 21 | /// The name of the database where the query is processed. 22 | /// 23 | /// Returns null if the source server does not support multiple databases. 24 | string Name { get; } 25 | } 26 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Summary/IInputPosition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// An input position refers to a specific character in a query. 19 | public interface IInputPosition 20 | { 21 | /// Gets the character offset referred to by this position; offset numbers start at 0. 22 | int Offset { get; } 23 | 24 | /// Gets the line number referred to by the position; line numbers start at 1. 25 | int Line { get; } 26 | 27 | /// Gets the column number referred to by the position; column numbers start at 1. 28 | int Column { get; } 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Summary/IServerInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// Provides basic information of the server where the cypher query was executed. 19 | public interface IServerInfo 20 | { 21 | /// Get the address of the server 22 | string Address { get; } 23 | 24 | /// Get the protocol version 25 | string ProtocolVersion { get; } 26 | 27 | /// Get the entire server agent string 28 | string Agent { get; } 29 | } 30 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Summary/QueryType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// The type of a query. 19 | public enum QueryType 20 | { 21 | /// The query type is unknown 22 | Unknown, 23 | 24 | /// The query is a readonly query 25 | ReadOnly, 26 | 27 | /// The query is a readwrite query 28 | ReadWrite, 29 | 30 | /// The query is a writeonly query 31 | WriteOnly, 32 | 33 | /// The query is a schemawrite query 34 | SchemaWrite 35 | } 36 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Types/INode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using System; 17 | using System.Collections.Generic; 18 | 19 | namespace Neo4j.Driver; 20 | 21 | /// Represents a Node in the Neo4j graph database. 22 | public interface INode : IEntity, IEquatable 23 | { 24 | /// Gets the lables of the node. 25 | IReadOnlyList Labels { get; } 26 | } 27 | -------------------------------------------------------------------------------- /Neo4j.Driver/Neo4j.Driver/Public/Types/INotificationsConfig.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) "Neo4j" 2 | // Neo4j Sweden AB [https://neo4j.com] 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"). 5 | // You may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | namespace Neo4j.Driver; 17 | 18 | /// 19 | /// Marker interface for configuration objects of notifications.

Notification configuration allows the 20 | /// driver to specify which notification categories or severities to ignore when analyzing queries. 21 | ///
22 | /// 23 | /// 24 | /// 25 | /// 26 | /// 27 | public interface INotificationsConfig 28 | { 29 | } 30 | -------------------------------------------------------------------------------- /docfx/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # folder # 3 | ############### 4 | /**/DROP/ 5 | /**/TEMP/ 6 | /**/packages/ 7 | /**/bin/ 8 | /**/obj/ 9 | _site 10 | api/ -------------------------------------------------------------------------------- /docfx/filterConfig.yaml: -------------------------------------------------------------------------------- 1 | apiRules: 2 | - exclude: 3 | uidRegex: ^System\..+$ 4 | type: Namespace -------------------------------------------------------------------------------- /docfx/images/neo4j-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j/neo4j-dotnet-driver/404334ee6f1496dd54ab53c8fc2e939bddbbdf68/docfx/images/neo4j-logo.png -------------------------------------------------------------------------------- /docfx/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | redirect_url: api/Neo4j.Driver.html 3 | --- -------------------------------------------------------------------------------- /docfx/neo4j-template/public/main.css: -------------------------------------------------------------------------------- 1 | .navbar .navbar-nav { 2 | display: none; 3 | } 4 | 5 | #logo { 6 | width: 48px; 7 | height: 48px; 8 | margin-right: 16px; 9 | } -------------------------------------------------------------------------------- /docfx/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Neo4j Bolt Driver for .NET 2 | href: api/toc.yml 3 | 4 | -------------------------------------------------------------------------------- /testkit/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 2 | 3 | RUN apt update \ 4 | && ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime \ 5 | && DEBIAN_FRONTEND=noninteractive apt install -y tzdata \ 6 | && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure --frontend noninteractive tzdata \ 7 | && rm -rf /var/lib/apt/lists/* 8 | 9 | RUN apt update \ 10 | && apt install -y python3 \ 11 | && rm -rf /var/lib/apt/lists/* 12 | 13 | # install .NET runtime 6.0.0 14 | RUN wget https://dot.net/v1/dotnet-install.sh 15 | RUN bash dotnet-install.sh --channel 6.0 --install-dir /usr/share/dotnet 16 | 17 | ENV PYTHON=python3 18 | ENV DOTNET_DRIVER_USING_LOCAL_SERVER=true 19 | ENV TEST_NEO4J_USING_TESTKIT=true 20 | ENV TK_CUSTOM_CA_PATH="/usr/local/share/custom-ca-certificates/" 21 | 22 | # Install our own CAs on the image. 23 | # Assumes Linux Debian based image. 24 | COPY CAs/* /usr/local/share/ca-certificates/ 25 | RUN update-ca-certificates 26 | 27 | COPY CustomCAs/* /usr/local/share/custom-ca-certificates/ -------------------------------------------------------------------------------- /testkit/backend.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executed in dotnet driver container. 3 | Assumes driver and backend has been built. 4 | Responsible for starting the test backend. 5 | """ 6 | 7 | import os, subprocess, sys 8 | 9 | 10 | if __name__ == "__main__": 11 | backend_path = os.path.join( 12 | "bin", "Publish", "Neo4j.Driver.Tests.TestBackend.dll" 13 | ) 14 | logfile_path = os.path.join("..", "artifacts", "backend.log") 15 | 16 | subprocess.check_call( 17 | ["dotnet", backend_path, "0.0.0.0", "9876", logfile_path], 18 | stdout=sys.stdout, stderr=sys.stderr 19 | ) 20 | 21 | -------------------------------------------------------------------------------- /testkit/build.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executed in dotnet driver container. 3 | Responsible for building driver and test backend. 4 | """ 5 | import os, subprocess 6 | 7 | 8 | def run(args): 9 | subprocess.run( 10 | args, universal_newlines=True, stderr=subprocess.STDOUT, check=True) 11 | 12 | if __name__ == "__main__": 13 | run(["dotnet", "restore", "--disable-parallel", "-v", "n", "Neo4j.Driver/Neo4j.Driver.sln"]) 14 | run(["dotnet", "clean", "./Neo4j.Driver/Neo4j.Driver.sln"]) 15 | run(["dotnet", "build", "./Neo4j.Driver/Neo4j.Driver.sln"]) 16 | run(["dotnet", "publish", "./Neo4j.Driver/Neo4j.Driver.Tests.TestBackend/Neo4j.Driver.Tests.TestBackend.csproj", "--self-contained", "false", "--output", "./bin/Publish"]) -------------------------------------------------------------------------------- /testkit/stress.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | 4 | 5 | if __name__ == "__main__": 6 | uri = "%s://%s:%s" % ( 7 | os.environ["TEST_NEO4J_SCHEME"], 8 | os.environ["TEST_NEO4J_HOST"], 9 | os.environ["TEST_NEO4J_PORT"]) 10 | user = os.environ["TEST_NEO4J_USER"] 11 | password = os.environ["TEST_NEO4J_PASS"] 12 | is_cluster = os.environ.get("TEST_NEO4J_IS_CLUSTER", False) 13 | os.environ['NEO4J_USER'] = user 14 | os.environ['NEO4J_PASSWORD'] = password 15 | os.environ['NEO4J_URI'] = uri 16 | 17 | cmd = [ 18 | "dotnet", 19 | "test", 20 | "--no-restore", 21 | "--no-build" 22 | ] 23 | 24 | if os.environ.get("TEST_NEO4J_IS_CLUSTER"): 25 | cmd.append("--filter") 26 | cmd.append("DisplayName~CausalClusterStressTests") 27 | else: 28 | cmd.append("--filter") 29 | cmd.append("DisplayName~SingleInstanceStressTests") 30 | 31 | subprocess.run(cmd, universal_newlines=True, 32 | stderr=subprocess.STDOUT, check=True, 33 | cwd="Neo4j.Driver/Neo4j.Driver.Tests.Integration") 34 | -------------------------------------------------------------------------------- /testkit/testkit.json: -------------------------------------------------------------------------------- 1 | { 2 | "testkit": { 3 | "uri": "https://github.com/neo4j-drivers/testkit.git", 4 | "ref": "5.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /testkit/unittests.py: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | Executed in dotnet driver container. 4 | Responsible for running unit tests. 5 | Assumes driver has been setup by build script prior to this. 6 | """ 7 | import os, subprocess 8 | 9 | 10 | def run(args): 11 | subprocess.run( 12 | args, universal_newlines=True, stderr=subprocess.STDOUT, check=True) 13 | 14 | if __name__ == "__main__": 15 | 16 | # run the dotnet test framework from the neo4j.driver/neo4j.driver.tests directory. 17 | wd = os.getcwd() 18 | os.chdir("Neo4j.Driver/Neo4j.Driver.Tests") 19 | # This generates a bit ugly output when not in TeamCity, it can be fixed by checking the TEST_IN_TEAMCITY 20 | # environment flag...(but needs to be passed to the container somehow) 21 | os.environ.update({"TEAMCITY_PROJECT_NAME":"unittests"}) 22 | run(["dotnet", "test", "Neo4j.Driver.Tests.csproj"]) 23 | os.chdir(wd) 24 | 25 | --------------------------------------------------------------------------------