Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
b5aa606
Update TODO.md
Vanderhoof Jun 23, 2021
0556482
Merge branch 'feature/reprs'
Vanderhoof Jul 12, 2021
ec94cd0
remove todo, update changelog
Vanderhoof Jul 12, 2021
254570d
add dbml property to all classes
Vanderhoof Jul 12, 2021
acfe864
udpate todo
Vanderhoof Jul 12, 2021
b4bd87a
add indexes to table dbml, fix error in index dbml
Vanderhoof Jul 12, 2021
7f58a25
fix column default dbml
Vanderhoof Jul 12, 2021
f8f47fc
add double quotes for names
Vanderhoof Jul 12, 2021
a4f7713
add dbml property to parser
Vanderhoof Jul 12, 2021
f467adc
update todo
Vanderhoof Jul 13, 2021
41f00a1
fix and test Reference sql. Add comment into Reference sql
Vanderhoof Jul 13, 2021
e4fb80f
fix and test TableReference sql, update changelog
Vanderhoof Jul 13, 2021
8e26ba4
add notes and comments to the rest of the classes sql, add tests
Vanderhoof Jul 13, 2021
37a2b9d
consistent line breaks in SQL
Vanderhoof Jul 13, 2021
2589c92
update readme
Vanderhoof Jul 13, 2021
0c44180
Merge branch 'feature/notes_comments'
Vanderhoof Jul 13, 2021
0832dfd
update changelog and bump version
Vanderhoof Jul 13, 2021
4e2bec6
update readme and todo
Vanderhoof Jul 13, 2021
1db1af4
fix subject names editing, fix table getitem after editing
Vanderhoof Jan 30, 2022
39850f5
fix enum
Vanderhoof Jan 30, 2022
503fbe4
PyDBML 1.0 WIP: restructure, blueprints for everything, Schema draft,…
Vanderhoof May 8, 2022
06a544c
Tests for reference class, create constants module, fix bugs caught b…
Vanderhoof May 10, 2022
decc5ec
Finish tests for classes, fix bugs
Vanderhoof May 11, 2022
a3292b6
Add more tests for classes, fix issues, start testing and changing Sc…
Vanderhoof May 12, 2022
d92324a
Finish tests for schema, fix test_docs and other bugs
Vanderhoof May 13, 2022
1ebf701
Finish old tests, fix found bugs
Vanderhoof May 14, 2022
d0db6a9
more tests, fix bugs, cleanup
Vanderhoof May 14, 2022
e9a5413
add doctests to test suite
Vanderhoof May 14, 2022
d68dc97
Expression is now class
Vanderhoof May 14, 2022
b3ecfdf
100% test coverage
Vanderhoof May 15, 2022
0b1e71f
Rename Schema -> Database
Vanderhoof May 17, 2022
76c4539
multiple schemas for tables and enums
Vanderhoof May 19, 2022
cebf5f1
pythonic variable and attribute names
Vanderhoof May 19, 2022
aa8b9de
type_ -> type
Vanderhoof May 19, 2022
bde47c3
validate add_index, cleanup imports
Vanderhoof May 19, 2022
1d3c9f7
fix enum type in column, adding enum items by string
Vanderhoof May 20, 2022
6132f5a
fix minor bugs, start docs
Vanderhoof May 20, 2022
abd89ec
continue docs
Vanderhoof May 21, 2022
4ac528a
init table with columns and indexes, finish main docs
Vanderhoof May 22, 2022
7a16e89
table1 and table2 properties on reference
Vanderhoof May 22, 2022
9b9798d
finish docs, update changelog
Vanderhoof May 22, 2022
bda2d7f
SQLOjbect -> SQLObject
Vanderhoof May 22, 2022
6781ccf
review docs
Vanderhoof May 22, 2022
a3a0000
Merge pull request #11 from Vanderhoof/feature/schema
Vanderhoof May 22, 2022
25c5673
bump version
Vanderhoof May 22, 2022
c6b44fd
add coverage badge
Vanderhoof May 22, 2022
e115ae9
fix Index type arg, update todo and tests.sh
Vanderhoof May 22, 2022
7889810
rename changelog, update license
Vanderhoof May 22, 2022
551ae3b
Update upgrading.md
Vanderhoof May 24, 2022
02f779d
Added classes and parser directories to setup.py
vosskj03 May 27, 2022
413a90d
Merge pull request #12 from vosskj03/add_missing_directories_to_setup
Vanderhoof May 28, 2022
204d648
Fix setup.py
Vanderhoof May 28, 2022
7fa8f8e
set schema1 on inline refs
jens-koster Jul 6, 2022
4fbf3e4
Merge pull request #17 from jens-koster/master
Vanderhoof Jul 10, 2022
ff0c582
add test for inline ref schema
Vanderhoof Jul 10, 2022
2ecf2b9
update gitignore
Vanderhoof Jul 10, 2022
08a20b5
update changelog
Vanderhoof Jul 10, 2022
4eb6951
attempt to fix #16
Vanderhoof Jul 10, 2022
35984b0
fix #15, support note objects in project
Vanderhoof Jul 10, 2022
a09ed68
fix note formatting
Vanderhoof Jul 10, 2022
92ad694
added the reformat_notes parameter to parse_file
jens-koster Jul 12, 2022
5a9a896
Merge pull request #19 from jens-koster/file_note_formatting
Vanderhoof Jul 15, 2022
39bb79a
update todo and docstring
Vanderhoof Jul 24, 2022
dc171b7
add tests for note bp preformat
Vanderhoof Jul 24, 2022
65fe1a8
remove note reformatting
Vanderhoof Jul 24, 2022
3907068
update changelog
Vanderhoof Jul 24, 2022
758afb1
Merge pull request #18 from Vanderhoof/feature/note_formatting
Vanderhoof Jul 24, 2022
e032e0b
fix schema parsing in TableGroupBlueprint
Vanderhoof Jul 24, 2022
eb9e21f
Merge pull request #21 from Vanderhoof/feature/table_group_schema
Vanderhoof Jul 24, 2022
a929f84
note parent backref, support escape newline in notes, escape quotes i…
Vanderhoof Jul 24, 2022
b5040a6
Merge pull request #22 from Vanderhoof/feature/escapes
Vanderhoof Jul 24, 2022
389dd96
support many to many
Vanderhoof Aug 6, 2022
b600fdf
Update readme, add test for join table
Vanderhoof Aug 6, 2022
b533134
Fix typing
Vanderhoof Aug 6, 2022
f14833c
bump version
Vanderhoof Aug 6, 2022
d603805
Fix inline many to many references didn't work
Vanderhoof Sep 25, 2022
81a9020
update changelog and bump version
Vanderhoof Sep 25, 2022
4f36dd9
First defined referenced tables in SQL #23
Vanderhoof Oct 23, 2022
90f376c
Fix quotes in note text were not properly rendered in DBML and SQL
Vanderhoof Oct 23, 2022
4a125f6
Silence wrong mypy errors, update reorder tables
Vanderhoof Oct 23, 2022
48a8e56
Update changelog
Vanderhoof Oct 23, 2022
1d79762
bump version
Vanderhoof Oct 23, 2022
198fcdf
update docs, fix type annotation, update pyparsing dep version
Vanderhoof Nov 19, 2022
8685a10
junction table now has the schema of the first referenced table
Vanderhoof Nov 20, 2022
873ed5a
update changelog and bump version
Vanderhoof Nov 20, 2022
21cdfef
update readme
Vanderhoof Nov 20, 2022
c3c754d
fixed empty line stripping #26
Vanderhoof Dec 11, 2022
472ddfb
update changelog
Vanderhoof Dec 11, 2022
4cd3101
add public get_references_for_sql table method
Vanderhoof Dec 11, 2022
07ce650
update changelog and docs
Vanderhoof Dec 11, 2022
3f83a6f
bump version
Vanderhoof Dec 11, 2022
93ee4a3
fix remove_indentation bug
Vanderhoof Dec 11, 2022
1dc5670
bump version
Vanderhoof Dec 11, 2022
0f05fb9
allow comments after structures like table
Vanderhoof May 14, 2023
f1d978c
bump version, update readme
Vanderhoof May 14, 2023
fb485d1
Fix enum collision
ewdurbin May 22, 2023
b005025
Merge pull request #28 from ewdurbin/main
Vanderhoof May 23, 2023
935140b
fix test
Vanderhoof May 23, 2023
1aeae9a
update changelog, bump version
Vanderhoof May 23, 2023
fb8b4d7
fix class name in docx
4383 May 26, 2023
005b981
Merge pull request #30 from 4383/master
Vanderhoof Jun 15, 2023
860f71f
test: update enum test, readme version compliance
Vanderhoof Oct 31, 2023
71d63f5
fix missing headercolor setting in Table dbml generation
tristangrebot Mar 15, 2024
952fd07
Merge pull request #32 from tristangrebot/master
Vanderhoof Mar 15, 2024
d276e46
feat: allow arrays in column type (v3.1.0)
Vanderhoof Mar 16, 2024
a21d32b
feat: allow double quotes in expression (v3.1.2)
Vanderhoof Mar 16, 2024
a6a4e84
feat: fix equality check, don't allow duplicate tables in tablegroup …
Vanderhoof Mar 17, 2024
048b348
feat: fix equality check again, don't allow duplicate refs (v3.1.6)
Vanderhoof Mar 17, 2024
f945dc8
feat: add sticky notes (v3.2.0)
Vanderhoof Mar 17, 2024
4f21e39
chore: bump version, update readme and changelog
Vanderhoof Mar 17, 2024
872be6d
Merge pull request #33 from Vanderhoof/feat/catch_up_syntax
Vanderhoof Mar 17, 2024
77e24d4
fix(indexes): let pk being named (#35)
pierresouchay Apr 23, 2024
6e0af33
bump version
Vanderhoof Apr 23, 2024
90c63c8
Rewrite SQL and DBML rendering (#39)
Vanderhoof Jul 18, 2024
b5c1662
Dynamic Options (#41)
Vanderhoof Jul 25, 2024
4fbe049
feat: unicode identifiers
Vanderhoof Jul 25, 2024
f43deae
update changelog, readme, bump version
Vanderhoof Jul 25, 2024
2e5e32c
Merge branch 'develop' of github.com:Vanderhoof/PyDBML into develop
Vanderhoof Jul 25, 2024
34d8889
Merge pull request #42 from Vanderhoof/develop
Vanderhoof Jul 25, 2024
c9ef6ed
adds sql_renderer arg to parser
big-c-note Aug 6, 2024
dc16163
Merge pull request #44 from big-c-note/feature/parse-with-renderer
Vanderhoof Aug 11, 2024
056ee4e
add dbml renderer to parser
Vanderhoof Aug 11, 2024
2606d18
update changelog, bump version
Vanderhoof Aug 11, 2024
7ccd5c6
Fix bug in DBML column default rendering with single quotes
psw0625 Nov 26, 2024
30cecc2
Merge pull request #45 from ryanproback/feature/fix-column-default-es…
Vanderhoof Nov 28, 2024
85a7d07
fix: line breaks in column and index options are allowed (#48)
Vanderhoof Jan 6, 2025
1cb1c7c
Merge pull request #51 from Vanderhoof/feat/line_breaks_in_brackets
Vanderhoof Jan 6, 2025
6df3c2f
fix: table elements may go in any order (#49)
Vanderhoof Jan 6, 2025
2250d8a
Merge pull request #52 from Vanderhoof/feat/table_note_position
Vanderhoof Jan 6, 2025
598dd2f
feat: TableGroup can have notes (DBML 3.7.2)
Vanderhoof Jan 7, 2025
91956be
Merge pull request #53 from Vanderhoof/feat/table_group_notes
Vanderhoof Jan 7, 2025
4075e62
update docs
Vanderhoof Jan 7, 2025
64ecc29
feat: TableGroup can have color (DBML 3.7.4)
Vanderhoof Jan 7, 2025
11143b8
Merge pull request #54 from Vanderhoof/feat/table_group_color
Vanderhoof Jan 7, 2025
eb0c510
resolve conflicts
Vanderhoof Jan 7, 2025
e372adc
Merge pull request #50 from Vanderhoof/feat/quote_object_name
Vanderhoof Jan 7, 2025
a3c5875
update changelog and bump version
Vanderhoof Jan 7, 2025
03b5756
Merge branch 'develop' of github.com:Vanderhoof/PyDBML into develop
Vanderhoof Jan 7, 2025
3b9f8df
fix escape sequence
Vanderhoof Jan 7, 2025
04cac52
Merge pull request #55 from Vanderhoof/develop
Vanderhoof Jan 7, 2025
ea21dc1
feat(indexes): support all Postgresqsl index types
pierresouchay Jan 15, 2025
0801880
Merge pull request #57 from pierresouchay/added_support_for_other_ind…
Vanderhoof Jan 15, 2025
502fb09
chore: update index class type hint and docs
Vanderhoof Jan 15, 2025
47de70d
update changelog and bump version
Vanderhoof Jan 15, 2025
e8eab9c
feat(#58): remove trailing comma in Enum SQL
Vanderhoof Feb 14, 2025
2bf015c
update changelog and bump version
Vanderhoof Feb 14, 2025
a729522
Shorter multiple imports
Mar 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ build
dist
pydbml.egg-info
.mypy_cache
.coverage
.eggs
.idea
165 changes: 165 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# 1.1.4
- Fix: Remove trailing comma in Enum SQL (#58 thanks @ralfschulze for reporting)

# 1.1.3
- New: support more index types. Thanks @pierresouchay for the contribution.

# 1.1.2
- Fix: escaping single quotes in a column's default value. Thanks @ryanproback for the contribution
- Fix: TableGroup and Project name are now safely quoted on render. Thanks @ryanproback for reporting
- Fix: line breaks in column and index options are now allowed. Thanks @aardjon for reporting
- Fix: table elements order is now not enforced by the parser. Thanks @aardjon for reporting
- New: TableGroup now can have notes (DBML v.3.7.2)
- New: TableGroup now can have color (DBML v.3.7.4)

# 1.1.1
- New: SQL and DBML renderers can now be supplied to parser

# 1.1.0

- New: SQL and DBML rendering rewritten tow support external renderers
- New: allow unicode characters in identifiers (DBML v3.3.0)
- New: support for arbitrary table and column properties (#37)

# 1.0.11
- Fix: allow pk in named indexes (thanks @pierresouchay for the contribution)

# 1.0.10
- New: Sticky notes syntax (DBML v3.2.0)
- Fix: Table header color was not rendered in `dbml()` (thanks @tristangrebot for the contribution)
- New: allow array column types (DBML v3.1.0)
- New: allow double quotes in expressions (DBML v3.1.2)
- Fix: recursion in object equality check
- New: don't allow duplicate refs even if they have different inline method (DBML v3.1.6)

# 1.0.9

- Fix: enum collision from different schemas. Thanks @ewdurbin for the contribution

# 1.0.8

- Fix: (#27) allowing comments after Tables, Enums, etc. Thanks @marktaff for reporting

# 1.0.7

- Fix: removing indentation bug

# 1.0.6

- Fix: (#26) bug in note empty line stripping, thanks @Jaschenn for reporting
- New: get_references_for_sql table method

# 1.0.5

- Fix: junction table now has the schema of the first referenced table (as introduced in DBML 2.4.3)
- Fix: typing issue which failed for Python 3.8 and Python 3.9

# 1.0.4

- New: referenced tables in SQL are now defined first in SQL (#23 reported by @minhl)
- Fix: single quotes were not escaped in column notes (#24 reported by @fivegrant)

# 1.0.3

- Fix: inline many-to-many references were not rendered in sql

# 1.0.2

- New: "backslash newline" is supported in note text (line continuation)
- New: notes have reference to their parent. Note.sql now depends on type of parent (for tables and columns it's COMMENT ON clause)
- New: pydbml no longer splits long notes into multiple lines
- Fix: inline ref schema bug, thanks to @jens-koster
- Fix: (#16) notes were not idempotent, thanks @jens-koster for reporting
- Fix: (#15) note objects were not supported in project definition, thanks @jens-koster for reporting
- Fix: (#20) schema didn't work in table group definition, thanks @mjfii for reporting
- Fix: quotes in note text broke sql and dbml
- New: proper support of composite primary keys without creating an index
- New: support of many-to-many relationships

# 1.0.1

- Fixed setup.py, thanks to @vosskj03.

# 1.0.0

- New project architecture, full support for creating and editing DBML. See details in [Upgrading to PyDBML 1.0.0](docs/upgrading.md)
- New Expression class
- Support DBML 2.4.1 syntax:
- Multiline comments
- Multiple schemas

# 0.4.2

- Fix: after editing column name index dbml was not updated.
- Fix: enums with spaces in name were not applied.
- Fix: after editing column name table dict was not updated.
- Fix: after editing enum column type was not updated.
- Removed EnumType class. Only Enum is used now.

# 0.4.1

- Reworked `__repr__` and `__str__` methods on all classes. They are now much simplier and more readable.
- Comments on classes are now rendered as SQL comments in `sql` property (previously notes were rendered as comments on some classes).
- Notes on `Table` and `Column` classes are rendered as SQL comments in `sql` property: `COMMENT ON TABLE "x" is 'y'`.
- New: `dbml` property on most classes and on parsed results which returns the DBML code.
- Fix: sql for Reference and TableReference.

# 0.4.0

- New: Support composite references. **Breaks backward compatibility!** `col1`, `col2` attributes on `Reference` and `col`, `ref_col` attributes on `TableReference` are now lists of `Column` instead of `Column`.
- `TableGroup` now holds references to actual tables.

# 0.3.5

- New: Support references by aliases.
- New: Support indexes with expressions.
- New: You can now compare SQLObjects of same class.
- New: Add check for duplicate references on a table.
- Fix: minor bug fixes.

# 0.3.4

- Notes are now added as comments in SQL for tables, table columns, indeces, enums.

# 0.3.3

- Fix: bug in TableReference
- Fix: if schema had newline or comment at the end, it crashed parser

# 0.3.2

- Fix TableReference sql

# 0.3.1

- Fix: files in **UTF-8 with BOM** encoding couldn't be parsed.

# 0.3

- More tests and more bug fixes.
- Added index columns validation.
- Added table group items validation.
- References now contain link to Table and Column objects instead of just names.
- Indexes now contain link to Column objects instead of just names.

# 0.2

- Better syntax errors.
- sql for each object now contains in `sql` property instead of string rerpresentation. Added proper string representations.
- Added syntax tests.
- Million bugs fixed after testing.

# 0.1.1

- Comments are now parsed too if they are before [b] or on the same line [l] as the entity. Works for: tables[b], columns[lb], references [lb], indexes[lb], enum items [lb], enums [b], project [b] and table group [b]
- All class instances will now have an empty Note in `note` attribute instead of None.
- Add string representation for Note and EnumItem.
- Enum instance now acts like list of EnumItems.
- Add EnumType to use in column.type attribute.
- Column type is now replaced by EnumType instance if enum with such name is defined.
- Remove unnecessary ColumnType class.
- Fix: note definition, project definition, some other definitions

# 0.1

- Initial release
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021
Copyright (c) 2024

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading