Skip to content

Releases: JustinFrizzell/sqlconnect

v0.3.2

09 Mar 22:18
5b46c3c
Compare
Choose a tag to compare

This release includes updates to documentation.

v0.3.1

14 Jan 14:53
0ea518d
Compare
Choose a tag to compare

This patch release:

  • Fixes issue where incorrect kwarg "conn" was being passed to pd.read_sql_query().
  • Now explicitly passes kwargs to pd.read_sql_query()

v0.3.0

07 Jan 14:06
1a914f9
Compare
Choose a tag to compare

This release brings:

Updates to the Sqlconnector class

  • All key word arguments used in pandas.read_sql_query() can now be used in sql_to_df() and sql_to_df_str()
  • Added df_to_sql() method for creating / updating SQL tables from DataFrames
  • Updated docs to reflect recent changes

Update to the yaml structure

This structure is now more generic for compatibility with Postgres, MySQL and Oracle database management systems.

The config module now uses the SQLAlchemy URL.create() method to create the connection URL. This method handles edge cases like the '@' symbol in passwords and automatically provides port numbers.

The new structure is generally not expected to change in future.

Previous structure:

connections:
  Mssql:
    sqlalchemy_driver: 'mssql+pyodbc'
    server: 'mssql_db:1433'
    odbc_driver: 'ODBC+Driver+17+for+SQL+Server'
    database: 'master'
    username: '${MSSQL_USERNAME}'
    password: '${MSSQL_PASSWORD}'

New Structure:

connections:
  Mssql:
    dialect: 'mssql'
    dbapi: 'pyodbc'
    host: 'mssql_db'
    database: 'master'
    username: '${MSSQL_USERNAME}'
    password: '${MSSQL_PASSWORD}'
    options: 
      driver: 'ODBC Driver 17 for SQL Server'

v0.2.1

29 Nov 20:57
d093c85
Compare
Choose a tag to compare

This release brings:

  • Improved documentation in docstrings
  • Consistent naming of default configuration files (sqlconnect.yaml and sqlconnect.env)

v0.2.0

27 Nov 08:32
Compare
Choose a tag to compare

This release brings several updates:

When setting up a database connection, SQLconnect will now check the root of the project for a connections.yaml and .env file. If one or both cannot be found, it will check the users home directory. Saving the configuration files in the home directory is useful if different projects need to share the same configuration, or if you want to reduce the chance of accidently committing .env to version control.

Here are example absolute paths for the home directory it will search on different operating systems:

  1. macOS/Linux:

    • The home directory path typically looks like /Users/username on macOS and /home/username on most Linux distributions.
    • Example path: /Users/justin/connections.yaml (macOS) or /home/justin/connections.yaml (Linux).
  2. Windows:

    • On Windows, the home directory path often looks like C:\Users\username.
    • Example path: C:\Users\justin\connections.yaml.

Also:

  • Exposed the sqlalchmey engine as a property of the SQLconnector class allowing for more direct integration with core sqlalchemy functionality.
  • Added unit tests to cover the config and connector modules using the pytest framework.
  • Improved docstrings.
  • Added example environment variable .env file.
  • Added documentation using sphinx framework.

v0.1.0

15 Nov 22:53
8d9a78b
Compare
Choose a tag to compare

This release includes new SQL functions:

  • sql_to_df(query_path: str) returns a pandas DataFrame for a given path to a SQL file
  • sql_to_df_str(query: str) returns a pandas DataFrame for a given SQL string
  • execute_sql(sql_path: str) executes a SQL command from a given path to a SQL file, returns None
  • execute_sql_str(command: str) executes a SQL command from a given SQL string, returns None

v0.0.2

14 Nov 19:24
2e0f088
Compare
Choose a tag to compare

This release enables connections to databases that require usernames and passwords. A separate .env file is used to store credentials which are dynamically read into python at runtime from the system environment.

v0.0.1

12 Nov 22:25
Compare
Choose a tag to compare

Initial release of SQLconnect.

Features

  • Easy database connections using a YAML file.
  • Execution of SQL queries directly from .sql files.
  • Integration with pandas for seamless data manipulation.