-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#135] Support adding BinaryType Field
- Support adding BinaryType field. - Support forward migration with varchar to varbyte(size). - Support backward migration from varbyte to varchar(size). - Added BinaryType field to psycopg2 adapter. - Testing with example/dj-sql-explorer.
- Loading branch information
1 parent
804a3b8
commit 1b98282
Showing
9 changed files
with
195 additions
and
6 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
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,10 @@ | ||
from codecs import encode | ||
|
||
from psycopg2.extensions import Binary | ||
|
||
|
||
class RedshiftBinary(Binary): | ||
def getquoted(self) -> bytes: | ||
hex_encoded = encode(self.adapted, "hex_codec") | ||
statement = b"to_varbyte('%s', 'hex')::varbyte" % hex_encoded | ||
return statement |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
DATABASE_URL=redshift://user:password@<cluster>.<slug>.<region>.redshift.amazonaws.com:5439/<name>?DISABLE_SERVER_SIDE_CURSORS=True | ||
SECRET_KEY=django-insecure-key | ||
DEBUG=True |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Django<4 | ||
-e ../..[psycopg2-binary] | ||
django-environ==0.8.1 | ||
django-sql-explorer | ||
-e ../.. | ||
python-dateutil>=2.9 |
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
Django<4 | ||
-e ../..[psycopg2-binary] | ||
django-environ==0.8.1 | ||
-e ../.. |
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