Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

macrometa-target-mysql

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

macrometa-target-mysql

A Meltano target for MySQL.

  • 0.0.12
  • PyPI
  • Socket score

Maintainers
1

macrometa-target-mongo

macrometa-target-mysql is a Macrometa connector for writing data into MySQL, can be used as a target for any Data Mesh Integration.

Installation

Use PIP for installation:

pip install macrometa-target-mysql

Configuration

The available configuration options for macrometa-target-mysql are:

PropertyTypeRequired?Description
hostStringYesMySQL host
portIntYesMySQL port
usernameStringYesMySQL user
passwordPasswordYesMySQL password
databaseStringYesMySQL database name
target_tableStringYesDestination table name
batch_flush_sizeIntNoMaximum size of batch. Exceeding this will trigger a batch flush
batch_flush_intervalIntNoTime between batch flush executions
hard_deleteBooleanNoWhen hard_delete option is true, DELETE SQL commands will be performed in MySQL to delete rows
add_metadata_columnsBooleanNoMetadata columns add extra row level information about data ingestion,
(i.e. when was the row read in source, when was inserted or deleted in MySQL etc.) Metadata
columns are created automatically by adding extra columns to the tables with a column prefix _SDC_.
The column names are following the stitch naming conventions documented at
link.
sslBooleanNoIf set to true then use SSL for connecting with MySQL.
If the server does not accept SSL connections or the client certificate is not recognized
then the connection will fail.
ssl_check_hostnameBooleanNoFlag to configure whether SSL handshake should verify that the certificate
matches the DB hostname.
ssl_root_ca_certFileNoSpecific CA certificate in PEM string format. This is most often the case
when using self-signed server certificate.
ssl_client_certificateFileNoSpecific client certificate in PEM string format. The private key for the client
certificate should be specified in a different parameter, SSL Client Key.
ssl_client_keyFileNoSpecific client key in PEM string format.

Configurations can be stored in a JSON configuration file and specified using the --config flag with macrometa-target-mysql.

Usage

cat <input_stream> | macrometa-target-mysql --config <config.json>
  • <input_stream>: Input data stream
  • <config.json>: JSON configuration file

macrometa-target-mysql reads data from a Singer Tap and writes it to a MySQL database. Run Singer Tap to generate data before launching macrometa-target-mysql.

Here's an example of using Singer Tap with macrometa-target-mysql:

tap-exchangeratesapi | target-mysql --config config.json

In this case, tap-exchangeratesapi is a Singer Tap that generates exchange rate data. The data is passed to macrometa-target-mysql through a pipe(|), and macrometa-target-mysql writes it to a MySQL database. config.json contains macrometa-target-mysql settings.

Developer Resources

Initializing the Development Environment

pipx install poetry
poetry install

Creating and Running Tests

Create tests in the macrometa_target_mysql/tests subfolder and run:

poetry run pytest

Use poetry run to test macrometa-target-mysql CLI interface:

poetry run target-mysql --help

Testing with Meltano

Note: This target functions within a Singer environment and does not require Meltano.

Firstly, install Meltano and necessary plugins:

# Install Meltano
pipx install meltano

# Initialize Meltano in this directory
cd target-mysql
meltano install

Then, test and orchestrate with Meltano:

# Call tests:
meltano invoke macrometa-target-mysql --version

# Or execute pipeline with Carbon Intensity sample tap:
meltano run tap-carbon-intensity target-mysql

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc