Discussion:
[phpMyAdmin Developers] Add support for CHECK constraints
Lakshay arora
2018-07-03 20:42:50 UTC
Permalink
Hello,
I'm currently working on this
<https://github.com/phpmyadmin/phpmyadmin/issues/13592>(Add support for
CHECK constraints), as a part of my GSOC project.

As Isaac has written in his comment, this feature involves three parts. The
order in which I want to work on this is the following -
1. Implement an interface for interacting with these constraints
2. Update parser to understand this syntax
3. Update the export interface to allow including these in an export

For the first part-
I am thinking of implementing this something like query by example,
- we show the operator in a select dropdown, and 2 options, to enter
value or another column name
The constraints will be shown like indexes are, in the table structure,
where there will be an option to delete or add new check constraint on the
table.

For second and third parts-
Not sure yet.
Lakshay arora
2018-07-05 05:09:18 UTC
Permalink
Hello,
I've made the ui for adding check constraints. Ive taken reference from qbe.
But it generates sql query in javascript in the file db_multi_table_query.js
I'm unsure whether I should generate the query on client or server side??
Any suggestions??
Post by Lakshay arora
Hello,
I'm currently working on this
<https://github.com/phpmyadmin/phpmyadmin/issues/13592>(Add support for
CHECK constraints), as a part of my GSOC project.
As Isaac has written in his comment, this feature involves three parts.
The order in which I want to work on this is the following -
1. Implement an interface for interacting with these constraints
2. Update parser to understand this syntax
3. Update the export interface to allow including these in an export
For the first part-
I am thinking of implementing this something like query by example,
- we show the operator in a select dropdown, and 2 options, to enter
value or another column name
The constraints will be shown like indexes are, in the table structure,
where there will be an option to delete or add new check constraint on the
table.
For second and third parts-
Not sure yet.
Maurício Meneghini Fauth
2018-07-05 16:54:56 UTC
Permalink
Hi,

I think it would be better on the server side.

Maurício
Post by Lakshay arora
Hello,
I've made the ui for adding check constraints. Ive taken reference from qbe.
But it generates sql query in javascript in the file
db_multi_table_query.js
I'm unsure whether I should generate the query on client or server side??
Any suggestions??
Post by Lakshay arora
Hello,
I'm currently working on this
<https://github.com/phpmyadmin/phpmyadmin/issues/13592>(Add support for
CHECK constraints), as a part of my GSOC project.
As Isaac has written in his comment, this feature involves three parts.
The order in which I want to work on this is the following -
1. Implement an interface for interacting with these constraints
2. Update parser to understand this syntax
3. Update the export interface to allow including these in an export
For the first part-
I am thinking of implementing this something like query by example,
- we show the operator in a select dropdown, and 2 options, to enter
value or another column name
The constraints will be shown like indexes are, in the table structure,
where there will be an option to delete or add new check constraint on the
table.
For second and third parts-
Not sure yet.
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
Lakshay arora
2018-07-07 07:42:21 UTC
Permalink
Since mysql does not provide an option to edit a check constraint or even
to describe it, I was thinking about making that functionality myself.
Check constraints will be saved in a table named pma_checkConstraints in
phpmyadmin databse, where we will store all the info about ccs. This way,
we can also add an option to edit a cc.
I'll also create a new class CheckConstraint which will handle all the
functionality.
Any suggestions??

On Thu, Jul 5, 2018 at 10:24 PM, Maurício Meneghini Fauth <
Post by Maurício Meneghini Fauth
Hi,
I think it would be better on the server side.
Maurício
Post by Lakshay arora
Hello,
I've made the ui for adding check constraints. Ive taken reference from qbe.
But it generates sql query in javascript in the file
db_multi_table_query.js
I'm unsure whether I should generate the query on client or server side??
Any suggestions??
Post by Lakshay arora
Hello,
I'm currently working on this
<https://github.com/phpmyadmin/phpmyadmin/issues/13592>(Add support for
CHECK constraints), as a part of my GSOC project.
As Isaac has written in his comment, this feature involves three parts.
The order in which I want to work on this is the following -
1. Implement an interface for interacting with these constraints
2. Update parser to understand this syntax
3. Update the export interface to allow including these in an export
For the first part-
I am thinking of implementing this something like query by example,
- we show the operator in a select dropdown, and 2 options, to enter
value or another column name
The constraints will be shown like indexes are, in the table structure,
where there will be an option to delete or add new check constraint on the
table.
For second and third parts-
Not sure yet.
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
Isaac Bennetch
2018-07-11 02:59:59 UTC
Permalink
Hi developers,

On Sat, Jul 7, 2018 at 3:42 AM, Lakshay arora
Since mysql does not provide an option to edit a check constraint or even to
describe it, I was thinking about making that functionality myself. Check
constraints will be saved in a table named pma_checkConstraints in
phpmyadmin databse, where we will store all the info about ccs. This way, we
can also add an option to edit a cc.
I'll also create a new class CheckConstraint which will handle all the
functionality.
Any suggestions??
I'm uncertain about this feature. On one hand, it seems like an area
where we could provide some extra functionality that MySQL doesn't —
similar to how we supported relations between tables before InnoDB was
so popular. On the other hand, it's not something that's been
requested much, isn't expected since it's outside the scope of MySQL's
features, and is something that I imagine MySQL will eventually
support anyway. Having it in place would only benefit users when using
phpMyAdmin directly rather than using any application.

I have a slight inclination to say no to this idea, but I certainly
could be swayed another way.

Isaac
Lakshay arora
2018-07-13 08:50:48 UTC
Permalink
I need some help with this.
To extend mysql feature, we have to use configuration storage(phpmyadmin
database) and it is not set, then I'll have to disable this feature
completely(like it doesn't exist).
we don't use configuration storage and use only the features provided by
mysql.
Any suggestions.
Post by Isaac Bennetch
Hi developers,
On Sat, Jul 7, 2018 at 3:42 AM, Lakshay arora
Post by Lakshay arora
Since mysql does not provide an option to edit a check constraint or
even to
Post by Lakshay arora
describe it, I was thinking about making that functionality myself. Check
constraints will be saved in a table named pma_checkConstraints in
phpmyadmin databse, where we will store all the info about ccs. This
way, we
Post by Lakshay arora
can also add an option to edit a cc.
I'll also create a new class CheckConstraint which will handle all the
functionality.
Any suggestions??
I'm uncertain about this feature. On one hand, it seems like an area
where we could provide some extra functionality that MySQL doesn't —
similar to how we supported relations between tables before InnoDB was
so popular. On the other hand, it's not something that's been
requested much, isn't expected since it's outside the scope of MySQL's
features, and is something that I imagine MySQL will eventually
support anyway. Having it in place would only benefit users when using
phpMyAdmin directly rather than using any application.
I have a slight inclination to say no to this idea, but I certainly
could be swayed another way.
Isaac
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
Isaac Bennetch
2018-07-13 14:43:36 UTC
Permalink
Post by Lakshay arora
I need some help with this.
To extend mysql feature, we have to use configuration storage(phpmyadmin database) and it is not set, then I'll have to disable this feature completely(like it doesn't exist).
we don't use configuration storage and use only the features provided by mysql.
Any suggestions.
That's correct. You may be able to use one of the existing tables or make a new one, but either way if the table doesn't exist, if the configuration storage database doesn't, or if they aren't configured you'll need to just disable the feature.

A good example of how that is handled already is with the internal relations feature that works similar to InnoDB relations.

You've got the right idea, though. If the user doesn't have the proper table structure or has disabled the feature in config.inc.php then we should just disable the enhancement entirely.

Does that help?
Post by Lakshay arora
Post by Isaac Bennetch
Hi developers,
On Sat, Jul 7, 2018 at 3:42 AM, Lakshay arora
Since mysql does not provide an option to edit a check constraint or even to
describe it, I was thinking about making that functionality myself. Check
constraints will be saved in a table named pma_checkConstraints in
phpmyadmin databse, where we will store all the info about ccs. This way, we
can also add an option to edit a cc.
I'll also create a new class CheckConstraint which will handle all the
functionality.
Any suggestions??
I'm uncertain about this feature. On one hand, it seems like an area
where we could provide some extra functionality that MySQL doesn't —
similar to how we supported relations between tables before InnoDB was
so popular. On the other hand, it's not something that's been
requested much, isn't expected since it's outside the scope of MySQL's
features, and is something that I imagine MySQL will eventually
support anyway. Having it in place would only benefit users when using
phpMyAdmin directly rather than using any application.
I have a slight inclination to say no to this idea, but I certainly
could be swayed another way.
Isaac
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
Lakshay arora
2018-07-14 05:07:55 UTC
Permalink
Yes,
Thank you
Post by Lakshay arora
I need some help with this.
To extend mysql feature, we have to use configuration storage(phpmyadmin
database) and it is not set, then I'll have to disable this feature
completely(like it doesn't exist).
we don't use configuration storage and use only the features provided by mysql.
Any suggestions.
That's correct. You may be able to use one of the existing tables or make
a new one, but either way if the table doesn't exist, if the configuration
storage database doesn't, or if they aren't configured you'll need to just
disable the feature.
A good example of how that is handled already is with the internal
relations feature that works similar to InnoDB relations.
You've got the right idea, though. If the user doesn't have the proper
table structure or has disabled the feature in config.inc.php then we
should just disable the enhancement entirely.
Does that help?
Post by Isaac Bennetch
Hi developers,
On Sat, Jul 7, 2018 at 3:42 AM, Lakshay arora
Post by Lakshay arora
Since mysql does not provide an option to edit a check constraint or
even to
Post by Lakshay arora
describe it, I was thinking about making that functionality myself.
Check
Post by Lakshay arora
constraints will be saved in a table named pma_checkConstraints in
phpmyadmin databse, where we will store all the info about ccs. This
way, we
Post by Lakshay arora
can also add an option to edit a cc.
I'll also create a new class CheckConstraint which will handle all the
functionality.
Any suggestions??
I'm uncertain about this feature. On one hand, it seems like an area
where we could provide some extra functionality that MySQL doesn't —
similar to how we supported relations between tables before InnoDB was
so popular. On the other hand, it's not something that's been
requested much, isn't expected since it's outside the scope of MySQL's
features, and is something that I imagine MySQL will eventually
support anyway. Having it in place would only benefit users when using
phpMyAdmin directly rather than using any application.
I have a slight inclination to say no to this idea, but I certainly
could be swayed another way.
Isaac
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
Lakshay arora
2018-07-15 08:10:01 UTC
Permalink
I'm working on the parser. I'm seeing the code for the first time. Can
someone give me a head start.
Post by Lakshay arora
Yes,
Thank you
Post by Lakshay arora
I need some help with this.
To extend mysql feature, we have to use configuration storage(phpmyadmin
database) and it is not set, then I'll have to disable this feature
completely(like it doesn't exist).
we don't use configuration storage and use only the features provided by mysql.
Any suggestions.
That's correct. You may be able to use one of the existing tables or make
a new one, but either way if the table doesn't exist, if the configuration
storage database doesn't, or if they aren't configured you'll need to just
disable the feature.
A good example of how that is handled already is with the internal
relations feature that works similar to InnoDB relations.
You've got the right idea, though. If the user doesn't have the proper
table structure or has disabled the feature in config.inc.php then we
should just disable the enhancement entirely.
Does that help?
Post by Isaac Bennetch
Hi developers,
On Sat, Jul 7, 2018 at 3:42 AM, Lakshay arora
Post by Lakshay arora
Since mysql does not provide an option to edit a check constraint or
even to
Post by Lakshay arora
describe it, I was thinking about making that functionality myself.
Check
Post by Lakshay arora
constraints will be saved in a table named pma_checkConstraints in
phpmyadmin databse, where we will store all the info about ccs. This
way, we
Post by Lakshay arora
can also add an option to edit a cc.
I'll also create a new class CheckConstraint which will handle all the
functionality.
Any suggestions??
I'm uncertain about this feature. On one hand, it seems like an area
where we could provide some extra functionality that MySQL doesn't —
similar to how we supported relations between tables before InnoDB was
so popular. On the other hand, it's not something that's been
requested much, isn't expected since it's outside the scope of MySQL's
features, and is something that I imagine MySQL will eventually
support anyway. Having it in place would only benefit users when using
phpMyAdmin directly rather than using any application.
I have a slight inclination to say no to this idea, but I certainly
could be swayed another way.
Isaac
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
Lakshay arora
2018-07-19 08:33:25 UTC
Permalink
Hi,
I'm working on exporting of check constraints. The problem is-
We can't access the definition of a constraint in mariadb. And we need the
definition of a constraint to save it in the sql dump file, Though I'm
saving the constraint in the configuration storage, if storage is not
configured, check constraints can't be dumped.
Post by Lakshay arora
I'm working on the parser. I'm seeing the code for the first time. Can
someone give me a head start.
On Sat, Jul 14, 2018 at 10:37 AM, Lakshay arora <
Post by Lakshay arora
Yes,
Thank you
Post by Lakshay arora
I need some help with this.
To extend mysql feature, we have to use configuration storage(phpmyadmin
database) and it is not set, then I'll have to disable this feature
completely(like it doesn't exist).
we don't use configuration storage and use only the features provided by mysql.
Any suggestions.
That's correct. You may be able to use one of the existing tables or
make a new one, but either way if the table doesn't exist, if the
configuration storage database doesn't, or if they aren't configured you'll
need to just disable the feature.
A good example of how that is handled already is with the internal
relations feature that works similar to InnoDB relations.
You've got the right idea, though. If the user doesn't have the proper
table structure or has disabled the feature in config.inc.php then we
should just disable the enhancement entirely.
Does that help?
Post by Isaac Bennetch
Hi developers,
On Sat, Jul 7, 2018 at 3:42 AM, Lakshay arora
Post by Lakshay arora
Since mysql does not provide an option to edit a check constraint or
even to
Post by Lakshay arora
describe it, I was thinking about making that functionality myself.
Check
Post by Lakshay arora
constraints will be saved in a table named pma_checkConstraints in
phpmyadmin databse, where we will store all the info about ccs. This
way, we
Post by Lakshay arora
can also add an option to edit a cc.
I'll also create a new class CheckConstraint which will handle all the
functionality.
Any suggestions??
I'm uncertain about this feature. On one hand, it seems like an area
where we could provide some extra functionality that MySQL doesn't —
similar to how we supported relations between tables before InnoDB was
so popular. On the other hand, it's not something that's been
requested much, isn't expected since it's outside the scope of MySQL's
features, and is something that I imagine MySQL will eventually
support anyway. Having it in place would only benefit users when using
phpMyAdmin directly rather than using any application.
I have a slight inclination to say no to this idea, but I certainly
could be swayed another way.
Isaac
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
_______________________________________________
Developers mailing list
https://lists.phpmyadmin.net/mailman/listinfo/developers
Loading...