semvec/pypi-packages huggingface dataset:
beam-mysql-connector 1.8.6
Apache Beam I/O connector designed for accessing MySQL databases.
License: MIT
Requires Python: <3.12,>=3.8
Keywords: apache beam mysql connector

# 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.