Jump to: navigation, search

Db-string-type-cleanup

Revision as of 00:17, 23 October 2013 by Rick Harris (talk | contribs) (Adding table to db-string-type-cleanup)

Blueprint Name: db-string-type-cleanup

Summary

Rationale

We use String columns as the physical storage for many kinds of logical datatypes, whether it's a UUID as String(36), IPAddress as String(39), or generic strings which are usually String(255).

Right now, the standard is for developers to use SQLAlchemy's String type directly, where they pass in the desired length.


Count Type Notes
2 String(12) PCI Address
2 String(5) Protocol
2 String(8) PCI Device Type
4 String(4) PCI Vendor/Product IDs
5 String(39) IPAddress
7 String(256) Typos?
8 String(43) CIDR
56 String(36) UUID
388 String(255) Generic String

There are a few problems with this approach:

1. Cumbersome - it requires the developer to specify the exact length each time they a new string column. In most cases, you just want the 'standard' size, so you look around, decide that 255 is most common, and use that.

Design