This is a repository to store the functions used within the Neotoma Database for data access and updates. The Neotoma is a Postgres-based system, migrated from a SQL Server database. As such, at the current time, this repository largely reflects the state of transition between the two systems.
All individuals are welcome to contribute to this repository. Contributions are subject to the Code of Conduct for this repository.
- Steve Crawford - Penn State
- Simon Goring - University of Wisconsin
- Mike Stryker - Penn State
The repository is divided into two main folders, legacy and function. The legacy folder is intended to act as the store for the now deprecated SQL Server Stored Procedures. The function folder represents the newer Postgres functions. This folder is then divided into folders for each individual database schema.
This structure is not necessary, but has been implemented to help manage the workflow of rewriting the large number of functions associated with the original database.
This repository is currently intended to be read-only. The stored postgres functions can be updated using the Python3 script connect_remote.py by calling:
python3 connect_remote.pyThis program checks the pg_catalog and pulls each function within a defined set of namespaces, and returns each function as its own sql file to a folder in the function directory.
Functions are expected to follow (as much as possible) Simon Holywell's SQL Style Guide and the Postgres Coding Convention.
- Functions should be generated in standalone files
- Functions should be named using verbs
- Functions should refrain from using vendor specific functions
- Use C style commenting: /* . . . */
Please feel free to raise issues using the issue tracker on this repository.