Skip to content

rickythefox/pyodbc

 
 

Repository files navigation

pyodbc

Travis LICENSE PRs Welcome

Docker image with python 3.7 and pyodbc. Includes ODBC drivers for MSSQL, PostgreSQL and MySQL.

https://hub.docker.com/r/laudio/pyodbc

Usage

Pull the image

$ docker pull laudio/pyodbc

Using as a base image

Usually this is expected to be used as a base image for your python app or scripts that requires pyodbc; in such such your Dockerfile might look something like this:

FROM laudio/pyodbc:1.0.38

WORKDIR /source

# Add your source files.
COPY ["app", "./app"]
COPY ["setup.py", "./"]

RUN pip install .

CMD ["python", "app/main.py"]

Development

# 1. Clone this repository.
$ git clone [email protected]:laudio/pyodbc.git

# 2. Go to the cloned path.
$ cd pyodbc

# 3. Build a docker image.
$ make build

# 4. Run the container
$ docker run laudio/pyodbc:<tag>

Testing

You can build the test container image providing the flag --target=test and run it.

# Create .env.test file with your database connection creds
# using the the example file .env.example.
# You'll need to update .env.test with your values after this.
$ cp .env.example .env.test

# Build the test container image and run tests.
$ make clean build test

You can type check using pyright:

$ npm install -g pyright
$ make check

Examples

Simple Examples

Examples showing a basic use case.

  1. MSSQL Example
  2. PostgreSQL Example
  3. MySQL Example

Data Pipelines

Examples illustrating data pipelines using pyodbc.

  1. Data Transfer Example (PostgreSQL)
  2. Data Transfer Example (MSSQL)
  3. Data Transfer Example (MySQL)

Images

Image Description
pyodbc-sqlcmd An alternative image which includes laudio/pyodbc and sqlcmd.

License

Licensed under MIT.

About

Docker Image with python 3.7 and pyodbc

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 46.4%
  • Dockerfile 25.8%
  • Shell 21.3%
  • Makefile 6.5%