Re: Converting Postgres SQL constraint logic to PHP?

Поиск
Список
Период
Сортировка
От Ken Tanzer
Тема Re: Converting Postgres SQL constraint logic to PHP?
Дата
Msg-id CAD3a31X7xE_6UxWwPS-sH2ewzWaCBuGy2P2m5sks8uqLmdaQWQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Converting Postgres SQL constraint logic to PHP?  (rob stone <floriparob@gmail.com>)
Список pgsql-general
On Fri, Jun 10, 2016 at 1:54 PM, rob stone <floriparob@gmail.com> wrote:

Hi Ken,

Would this be static or dynamic?
For example, if you altered a column to become defined as NOT NULL,
say, when you build the form used to maintain that table you'd like to
have a "required" attribute against the input field for that column. So
if it were dynamic you'd have to access the database information_schema
each time you wanted to send the HTML down the wire as well as when
carrying out validation.

Hi Rob.  I guess this is currently static, in that whenever you change the tables you have to run an update process that rereads the tables and stores the configuration information.
 
Also, views are updateable and you'd have to check the tables and 
columns making up the view.

Yeah.  We're not using any updateable views at the moment, so for now I'd be happy for this to work with tables.  One step at a time! :)
 
I've never used pg_meta_data but it might be helpful.
Another thought would be to write a program that scanned all the tables
in your database and wrote out a table in your application's schema
where the table and column constraints were synthesised in a way
suitable for use in PHP code. 

I'm not sure I'm following this one.  Wouldn't such a program have to parse the SQL and convert it to PHP anyway?
 
Cheers,
Rob

Thanks!

Ken

--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

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

Предыдущее
От: Ken Tanzer
Дата:
Сообщение: Re: Converting Postgres SQL constraint logic to PHP?
Следующее
От: Sridhar N Bamandlapally
Дата:
Сообщение: Re: [HACKERS] Online DW