this python cmd line utility was originally written to serve a much larger application. I decided to re-write much of it and strip it out of its original home so that it would stand and run on its own, with bare bones functionality.\
Its purpose, in this particular context, is to create suitable DB models (table and field definitions) from published p4 schemas (in their XML format). Once "modelized", the models can be executed against a number of DB systems. For the purpose of this exercise (for the time being anyways), we will focus on 3, namely PostgresSQL, MySQL and SQLite. So, to continue, the defined models can (and should) be used to define a database's tables and fields that mirror the actual P4 DB where an optional cmd line arg can be employed to instruct dbmodelize.py to populate our databases with P4 metadata (simply provide one or many journal paths - compressed or not).
This utility will create an SQL DB against any released version of the P4 DB previously and currently available (from version 2006 & higher). Included is a cmd line option that will read the latest and most current published schema and add that data to the set of supported version (obviously, internet access is required to reach perforce.com).\
Users require nothing else than this packaged fileset, which also includes the dbapi's for both PostgresSQL & MySQL (SQLite API comes for free with python). One caveat, if targeting postgres or mysql, it is required that you provide a valid user name with the required privileges to access and write to the DB. As well, for those DB systems, the target DB must exist and be in an 'undefined' state before the initial run of dbmodelize. In the case of SQLite, all will be created where none exists. I will provide a 'usage.txt' file at the root of the project to detail the how-to's., available options and configurables. You can also type '>>> python dbmodelize.py -h' for further info.\
1) enable table inclusion/exclusion filters for populating the DB\ 2) link dbmodelize to 'p4Query' for search and query functionally (another small yet useful part of that larger application I mentioned above). This is forth coming.\
if someone tells me that they would find those 2 TODO items useful, I will add them without delay. As well, I am open to extending this utility should someone require additional features, as long as it makes sense to do so and so long as the requested functionality not already be planned to be posted and made available in an upcoming component. Anyways, let me know.\ As mentioned, the focus of this utility is mainly restricted to the functionality described above. Although there is much more to the DB interface than exposed here in this utility, I wanted to limit the scope and provide instead a modularized implementation, with easy integration between components. There is much more functionality to be made available (as separate and stand-alone components) as I continue to isolate and post other pieces of the bigger framework. Stay tuned for more fun!\ Oh, if someone wants to join in and do some edits, etc. then let me know.
### what is this ? this python cmd line utility was originally written to serve a much larger application. I decided to re-write much of it and strip it out of its original home so that it would stand and run on its own, with bare bones functionality.\ ### what is it for ? Its purpose, in this particular context, is to create suitable DB models (table and field definitions) from published p4 schemas (in their XML format). Once "modelized", the models can be executed against a number of DB systems. For the purpose of this exercise (for the time being anyways), we will focus on 3, namely PostgresSQL, MySQL and SQLite. So, to continue, the defined models can (and should) be used to define a database's tables and fields that mirror the actual P4 DB where an optional cmd line arg can be employed to instruct dbmodelize.py to populate our databases with P4 metadata (simply provide one or many journal paths - compressed or not). This utility will create an SQL DB against any released version of the P4 DB previously and currently available (from version 2006 & higher). Included is a cmd line option that will read the latest and most current published schema and add that data to the set of supported version (obviously, internet access is required to reach perforce.com).\ ### what are the requirements ? Users require nothing else than this packaged fileset, which also includes the dbapi's for both PostgresSQL & MySQL (SQLite API comes for free with python). One caveat, if targeting postgres or mysql, it is required that you provide a valid user name with the required privileges to access and write to the DB. As well, for those DB systems, the target DB must exist and be in an 'undefined' state before the initial run of dbmodelize. In the case of SQLite, all will be created where none exists. I will provide a 'usage.txt' file at the root of the project to detail the how-to's., available options and configurables. You can also type '>>> python dbmodelize.py -h' for further info.\ ### TODOS 1\) enable table inclusion/exclusion filters for populating the DB\ 2) link dbmodelize to 'p4Query' for search and query functionally (another small yet useful part of that larger application I mentioned above). This is forth coming.\ ### Note if someone tells me that they would find those 2 TODO items useful, I will add them without delay. As well, I am open to extending this utility should someone require additional features, as long as it makes sense to do so and so long as the requested functionality not already be planned to be posted and made available in an upcoming component. Anyways, let me know.\ As mentioned, the focus of this utility is mainly restricted to the functionality described above. Although there is much more to the DB interface than exposed here in this utility, I wanted to limit the scope and provide instead a modularized implementation, with easy integration between components. There is much more functionality to be made available (as separate and stand-alone components) as I continue to isolate and post other pieces of the bigger framework. Stay tuned for more fun!\ Oh, if someone wants to join in and do some edits, etc. then let me know.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 13792 | Lester Cheung | Archive of wiki.workshop.perforce.com in raw (mediawiki) and markdown formats. |