Package: shaped-target-clickhouse
target-clickhousetarget-clickhouseis a Singer target for clickhouse.Build with theMeltano Target SDK.ConfigurationAccepted Config OptionsSettingRequiredDefaultDescriptionsqlalchemy_urlFalseNoneThe SQLAlchemy connection string for the ClickHouse database. Used if set, otherwise separate settings are useddriverFalsehttpDriver typeusernameFalsedefaultDatabase userpasswordFalseNoneUsername passwordhostFalselocalhostDatabase hostportFalse8123Database connection portdatabaseFalsedefaultDatabase namesecureFalse0Should the connection be secureverifyFalse1Should secure connection need to verify SSL/TLSengine_typeFalseNoneThe engine type to use for the table.table_nameFalseNoneThe name of the table to write to. Defaults to stream name.table_pathFalseNoneThe table path for replicated tables. This is required when using any of the replication engines. Check out thedocumentationfor more information. Use$table_nameto substitute the table name.replica_nameFalseNoneThereplica_namefor replicated tables. This is required when using any of the replication engines.cluster_nameFalseNoneThe cluster to create tables in. This is passed as theclickhouse_clusterargument when creating a table.Documentationcan be found here.default_target_schemaFalseNoneThe default target database schema name to use for all streams.optimize_afterFalse0Run 'OPTIMIZE TABLE' after data insertoptimize_afterFalse0Run 'OPTIMIZE TABLE' after data insert. Useful whentable engine removes duplicate rows.load_methodFalseTargetLoadMethods.APPEND_ONLYThe method to use when loading data into the destination.append-onlywill always write all input records whether that records already exists or not.upsertwill update existing records and insert new records.overwritewill delete all existing records and insert all input records.stream_mapsFalseNoneConfig object for stream maps capability. For more information check outStream Maps.stream_map_configFalseNoneUser-defined config values to be used within map expressions.flattening_enabledFalseNone'True' to enable schema flattening and automatically expand nested properties.flattening_max_depthFalseNoneThe max depth to flatten schemas.A full list of supported settings and capabilities is available by running:target-clickhouse --aboutConfigure using environment variablesThis Singer target will automatically import any environment variables within the working directory's.envif the--config=ENVis provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the.envfile.Source Authentication and AuthorizationUsageYou can easily runtarget-clickhouseby itself or in a pipeline usingMeltano.Executing the Target Directlytarget-clickhouse--version
target-clickhouse--help# Test using the "Carbon Intensity" sample:tap-carbon-intensity|target-clickhouse--config/path/to/target-clickhouse-config.jsonDeveloper ResourcesFollow these instructions to contribute to this project.Initialize your Development Environmentpipxinstallpoetry
poetryinstallStart the Clickhouse containerIn order to run the tests locally, you must have a Docker daemon running on your host machine.You can start the Clickhouse container by running:./docker_run_clickhouse.shCreate and Run TestsCreate tests within thetestssubfolder and
then run:poetryrunpytestYou can also test thetarget-clickhouseCLI interface directly usingpoetry run:poetryruntarget-clickhouse--helpTesting withMeltanoNote:This target will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios.Next, install Meltano (if you haven't already) and any needed plugins:# Install meltanopipxinstallmeltano# Initialize meltano within this directorycdtarget-clickhouse
meltanoinstallNow you can test and orchestrate using Meltano:# Test invocation:meltanoinvoketarget-clickhouse--version# OR run a test `elt` pipeline with the Carbon Intensity sample tap:meltanoelttap-carbon-intensitytarget-clickhouseSDK Dev GuideSee thedev guidefor more instructions on how to use the Meltano Singer SDK to
develop your own Singer taps and targets.