An open API service indexing awesome lists of open source software.

https://github.com/esakik/beam-mysql-connector

An Apache Beam I/O connector for seamless integration with MySQL database 🔗 https://beam.apache.org/documentation/io/connectors/#other-io-connectors-for-apache-beam
https://github.com/esakik/beam-mysql-connector

apache-beam mysql pypi python

Last synced: 5 months ago
JSON representation

An Apache Beam I/O connector for seamless integration with MySQL database 🔗 https://beam.apache.org/documentation/io/connectors/#other-io-connectors-for-apache-beam

Awesome Lists containing this project

README

          

# Beam - MySQL Connector
[![PyPI version](https://badge.fury.io/py/beam-mysql-connector.svg)](https://badge.fury.io/py/beam-mysql-connector)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/beam-mysql-connector)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Beam - MySQL Connector is an io connector of [Apache Beam](https://beam.apache.org/) to access MySQL databases.

## Installation
```bash
pip install beam-mysql-connector
```

## Getting Started
- Read From MySQL
```Python
from beam_mysql.connector import splitters
from beam_mysql.connector.io import ReadFromMySQL

read_from_mysql = ReadFromMySQL(
query="SELECT * FROM test_db.tests;",
host="localhost",
database="test_db",
user="test",
password="test",
port=3306,
splitter=splitters.NoSplitter() # you can select how to split query for performance
)
```

- Write To MySQL
```Python
from beam_mysql.connector.io import WriteToMySQL

write_to_mysql = WriteToMySQL(
host="localhost",
database="test_db",
table="tests",
user="test",
password="test",
port=3306,
batch_size=1000,
)
```

## License
MIT License. Please refer to the [LICENSE.txt](https://github.com/esaki01/beam-mysql-connector/blob/master/LICENSE.txt), for further details.