Package: meltanolabs-tap-mysql
tap-mysqltap-mysqlis a Singer tap for mysql.Built with theMeltano Tap SDKfor Singer Taps.InstallationInstall from GitHub:pipxinstallgit+https://github.com/MeltanoLabs/tap-mysql.git@mainNote that you will also need to install the requisite dependencies for mysqlclient. Example installation command:sudoapt-getupdate
sudoapt-getinstallpackage-cfglibmysqlclient-devConfigurationAccepted Config OptionsSettingRequiredDefaultDescriptionhostFalseNoneHostname for mysql instance. Note if sqlalchemy_url is set this will be ignored.portFalse3306The port on which mysql is awaiting connection. Note if sqlalchemy_url is set this will be ignored.userFalseNoneUser name used to authenticate. Note if sqlalchemy_url is set this will be ignored.passwordFalseNonePassword used to authenticate. Note if sqlalchemy_url is set this will be ignored.databaseFalseNoneDatabase name. Note if sqlalchemy_url is set this will be ignored.sqlalchemy_urlFalseNoneExample mysql://[username]:[password]@localhost:3306/[db_name]ssh_tunnelFalseNoneSSH Tunnel Configuration, this is a json objectssh_tunnel.enableTrue (if ssh_tunnel set)FalseEnable an ssh tunnel (also known as bastion host), see the other ssh_tunnel.* properties for more details.ssh_tunnel.hostTrue (if ssh_tunnel set)FalseHost of the bastion host, this is the host we'll connect to via sshssh_tunnel.usernameTrue (if ssh_tunnel set)FalseUsername to connect to bastion hostssh_tunnel.portTrue (if ssh_tunnel set)22Port to connect to bastion hostssh_tunnel.private_keyTrue (if ssh_tunnel set)NonePrivate Key for authentication to the bastion hostssh_tunnel.private_key_passwordFalseNonePrivate Key Password, leave None if no password is setstream_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.batch_configFalseNoneA full list of supported settings and capabilities for this
tap is available by running:tap-mysql--aboutConfigure using environment variablesThis Singer tap 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.SSH Tunnels (Bastion Hosts)This tap supports connecting to a Postgres database via an SSH tunnel (also known as a bastion host). This is useful if you need to connect to a database that is not publicly accessible. This is the same as usingssh -Landssh -R, but this is done inside the tap itself.UsageYou can easily runtap-mysqlby itself or in a pipeline usingMeltano.Executing the Tap Directlytap-mysql--version
tap-mysql--help
tap-mysql--configCONFIG--discover>./catalog.jsonDeveloper ResourcesFollow these instructions to contribute to this project.Initialize your Development Environmentpipxinstallpoetry
poetryinstallCreate and Run TestsCreate tests within thetestssubfolder and
then run:poetryrunpytestYou can also test thetap-mysqlCLI interface directly usingpoetry run:poetryruntap-mysql--helpTesting withMeltanoNote:This tap 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 directorycdtap-mysql
meltanoinstallNow you can test and orchestrate using Meltano:# Test invocation:meltanoinvoketap-mysql--version# OR run a test `elt` pipeline:meltanoelttap-mysqltarget-jsonlSDK Dev GuideSee thedev guidefor more instructions on how to use the SDK to
develop your own taps and targets.