Dbbase

Latest version: v0.3.10

Safety actively analyzes 714772 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 5

0.2.7

Add
* Added `Model.filter_columns` to better address filtering columns for various characteristics. This function ties in with the documentation functions found in `DB`. Also, the column property to be selected can also be a negative. ex: !nullable would return all the required fields.

Changed
* Changed test formatting.

Removed
* Removed column_props from `DB.doc_table` as unhelpful.

0.2.5

Changed
* Changed treatment of serial fields and serial field relations to class methods solely to reduce ambiguity.

0.2.4

Added
* Added an option of a write-only column. With the ability to document fields of tables, it is useful to be able to identify fields that are write-only, such as password fields. The `Model.to_dict()` function outputs the contents of a record. If the output provides the basis for forms in the front-end, including the password field is natural and desirable. Once, the password has been added, however, encrypted or not, it should be excluded.

... python

class Table1(db.Model):
__tablename__ = "table1"

id = db.Column(db.Integer, primary_key=True)
password = db.WriteOnlyColumn(db.String, nullable=False)

db.create_all()

...

When use the documentation dictionary featuure, we now get:

... json

{
"Table1": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32",
"primary_key": true,
"nullable": false,
"info": {}
},
"password": {
"type": "string",
"nullable": false,
"info": {
"writeOnly": true
}
}
},
"xml": "Table1"
}
}

...

Using this we create two records, with and without a password.

... python

table1 = Table1(id=1)
table2 = Table1(id=2, password="some encrypted value")

>>> print(table1.to_dict())

{'id': 1, 'password': None},

>>> print(table2.to_dict())

{'id': 2}

...

The write-only field is thereby excluded. The basis for this functionality stems from the use of the info field.

0.2.3

Changed
* Changed the name of SERIAL_LIST to SERIAL_FIELDS, and RELATION_SERIAL_LISTS to SERIAL_FIELD_RELATIONS to better describe what they are. The parameters associated with using these variables are changed as well.

0.2.2

Added
* Added `db.doc_column` function that returns the documentation dictionary for a specific column.
* Added checking for valid foreign keys in `Model.validate_record`. Prior to attempting a save, the columns that cannot be null, and require foreign key validation are verified against the foreign table.

0.2.1

Added
* Added model documentation properties for functions, properties, and relationships. All of these are marked as readOnly: True. This additional feature gives a more complete picture of the characteristics of the model. Just as serialization is shaped by the function, `Model._get_serial_stop_list()`, only those items which pass that hurdle will be documented. That filter ensures that only meaningful items will be documented.
* Added model documentation properties for table constraints

Fixed
* Added `__repr__` and `__table__` to default stop lists

Page 3 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.