Code Organisation

Поиск
Список
Период
Сортировка
От Ravi Chemudugunta
Тема Code Organisation
Дата
Msg-id 7a4208ef0811181738v3f957fa6mcab7cfa4414a5c2@mail.gmail.com
обсуждение исходный текст
Ответы Re: Code Organisation  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Список pgsql-general
Hi,

I realise this may be a subjective topic ; however:

what does everyone think about grouping a set of functions together,
by related it maybe that they call on each other but more so live in
the same file on disk (before they get submitted) ... we are trying to
use the output of pg_dump for versioning rather than having our own
file for e.g. inventory.sql under the tree somewhere.

(does anyone have any ideas on the topic of version control itself ?)

The only problem with doing it this way is once the functions get
admitted into the database (and our inventory.sql file is deleted
because it will incorporated into pg_dump somewhere) all context is
lost,

somehow it seems like a a set of functions in a file helps you figure
out whats happening.

I have thought about two ways to group functions:

by prefix e.g. inventory_do_stuff() or
- use of schemas
inventory.do_stuff

the advantage of schemas is functions within the same related group do
not have to qualify access. for e.g. inventory_something() doesn't
have to call inventory_do_stuff() but rather just do_stuff() (ofcourse
this requires that inventory be in the search path).  I have written a
simple function that appends a schema to the search_path without
destroying it.

Is there any other ways to do this cleanly ?

--
:wq

В списке pgsql-general по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: How to reduce impact of a query.
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Code Organisation