Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Docs: Small fixes to new database driver guide
Browse files Browse the repository at this point in the history
  • Loading branch information
erezsh committed Nov 15, 2022
1 parent 6807991 commit 24322d6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/new-database-driver-guide.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
How to implement a new database driver for data-diff
====================================================

First, read through the CONTRIBUTING.md document.
First, read through the `CONTRIBUTING.md <https://github.com/datafold/data-diff/blob/master/CONTRIBUTING.md>`_ document.

Make sure data-diff is set up for development, and that all the tests pass (try to at least set it up for mysql and postgresql)

Expand Down Expand Up @@ -38,9 +38,9 @@ Choosing a base class, based on threading Model

You can choose to inherit from either ``base.Database`` or ``base.ThreadedDatabase``.

Usually, databases with cursor-based connections, like MySQL or Postgresql, only allow one thread per connection. In order to support multithreading, we implement them by inheriting from ``ThreadedDatabase``, which holds a pool of worker threads, and creates a new connection per thread.
Usually, databases with cursor-based connections, like MySQL or Postgresql, only allow connections to be used by the thread that created them. In order to support multithreading, we implement them by inheriting from ``ThreadedDatabase``, which holds a pool of worker threads, and creates a new connection per thread.

Usually, cloud databases, such as snowflake and bigquery, open a new connection per request, and support simultaneous queries from any number of threads. In other words, they already support multithreading, so we can implement them by inheriting directly from ``Database``.
Usually, cloud databases, such as Snowflake and BigQuery, open a new connection per request, and support simultaneous queries from any number of threads. In other words, they already support multithreading, so we can implement them by inheriting directly from ``Database``.

Import on demand
~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -130,7 +130,7 @@ Docs:
:meth:`quote()`, :meth:`to_string()`,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These methods are used when creating queries, to cast to quote a value or cast it to VARCHAR.
These methods are used when creating queries, to quote a value, or cast it to STRING/VARCHAR.

For more information, read their docs:

Expand Down Expand Up @@ -158,8 +158,8 @@ DECIMAL(10,3) needs to be parsed by a custom algorithm. You'd be using regex to
4. Debugging
-----------------------

You can enable debug logging for tests by setting the logger level to ``DEBUG`` in /tests/common.py
This will display all the queries ran + display types detected for columns.
You can enable debug logging for tests by setting the logger level to ``DEBUG``, via the environment variable ``LOG_LEVEL``, or the ``LOG_LEVEL`` variable in /tests/common.py.
This will display all the queries ran, and display the type detected for each column.

3. Add tests
--------------
Expand Down

0 comments on commit 24322d6

Please sign in to comment.