Skip to content

Support foreign keys#13

Open
diegonc wants to merge 2 commits intostoreness:masterfrom
diegonc:t/support-foreign-keys
Open

Support foreign keys#13
diegonc wants to merge 2 commits intostoreness:masterfrom
diegonc:t/support-foreign-keys

Conversation

@diegonc
Copy link
Copy Markdown

@diegonc diegonc commented Jun 3, 2016

This add supports for foreign key table constraints on the server side.
A new parameter was added to SQL.Server::createTable which specifies the table constraints to be used in the following format:

[ [ <constraint type> <constraint options>]
  ... ]

Currently the only constraint supported is FOREIGN KEY with the following inputs:

constraint type = '$foreign'
constraint options = { $key: [<column1>, ...],
                       $ref: { $table: <table name>,
                               $cols: [<foreign column 1>, ...] }}

But new ones can be added easily by extending the SQL.Sql::_Constraints object with new functions from options to a SQL clause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant