This repository has been archived by the owner on Aug 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from projectweekend/master
Remove JSON functions
- Loading branch information
Showing
4 changed files
with
21 additions
and
18 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 |
---|---|---|
@@ -1,18 +1,14 @@ | ||
def build_schema_query(table_schema): | ||
schema_query = """ | ||
WITH table_schema_info AS ( | ||
SELECT table_name, | ||
column_name, | ||
column_default, | ||
is_nullable, | ||
data_type, | ||
character_maximum_length | ||
FROM information_schema.columns | ||
WHERE table_schema = '{0}' | ||
ORDER BY table_name, | ||
ordinal_position | ||
) | ||
SELECT JSON_AGG(table_schema_info.*) | ||
FROM table_schema_info; | ||
SELECT table_name, | ||
column_name, | ||
column_default, | ||
is_nullable, | ||
data_type, | ||
character_maximum_length | ||
FROM information_schema.columns | ||
WHERE table_schema = '{0}' | ||
ORDER BY table_name, | ||
ordinal_position | ||
""".format(table_schema) | ||
return schema_query |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
setup( | ||
name='pg-table-markdown', | ||
version='1.0.3', | ||
version='1.0.4', | ||
author='Vokal', | ||
author_email='[email protected]', | ||
description='A command line tool that generates markdown documentation for Postgres tables in a given schema', | ||
|