-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more examples on how to initialize database with postgresql fixtu…
…re - refs #316
- Loading branch information
Showing
4 changed files
with
53 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from typing import Any | ||
from platform import python_implementation | ||
|
||
try: | ||
import psycopg2 | ||
if python_implementation() == "PyPy": | ||
from psycopg2cffi._impl.cursor import Cursor as cursor | ||
from psycopg2cffi._impl.coonnection import Connection as connection | ||
else: | ||
from psycopg2._psycopg import cursor | ||
from psycopg2._psycopg import connection | ||
except ImportError: | ||
psycopg2 = False | ||
# if there's no postgres, just go with the flow. | ||
# pylint:disable=invalid-name | ||
cursor = Any | ||
connection = Any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters