sarimurrab / NORM

NORM - No ORM framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NORM

NORM stands for No ORM framework. NORM is not a PosgreSQL extention, not a library, and not a set of functions.

NORM is an approach (a thechnology) which allows object-oriented applications to interact with relational databases directly, without involving any ORM. Why we want to avoid ORM? because it decreases application's performance.

The doc directory of the repo contains the ppt of the presentations from SOFSEM 2020 conference. Please take a look to find out why NORM was developed, and what are it's advantaes.

The sql directory contains a working example of how to build PostgreSQL types and functions using NORM technology.

Publications

The only published paper on NORM:

https://link.springer.com/chapter/10.1007%2F978-3-030-38919-2_54

TOC:

  • doc directory contains a Power Point presentation from SOFSEM 2020 conference, where NORM was first officially announced.
  • sql directory contains a working example of NORM usage.
  • to install an example, run the _load.all file from the sql directory
  • see file sql\examples.sql for usage examples

More on the NORM example

create_tables.sql creates three tables: account, phone and email and some lookiups.

initial_data_insert.sql does exactly what you think it does

array_transport.sql creates an array_transport funcion. That is the only function you want to save for your future usage, if you want to try NORM approach in your company.

account_pkg.sql presents the NORM approach. In our approach, we combine the UDT definitions and corresponding functions into one file, which we call a package, refrencing Oracle packages.

It includes types definitions, account_create function, account_search_by_id for simple search and account_search for complex search on the combination of criteria. The matching "select" functions convert the output into JSON converted to text for data transfer purposes.

Please refer to the presentation to learn why we are doing a transformation as a separate step.

Finally,the account_update function performs the update of complex object. IN addition to update, it allows to insert and delete deatail objects.

Note, that both insert and update functions also return new/modified object(s)

About

NORM - No ORM framework

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:PLpgSQL 100.0%