Skip Menu |

This queue is for tickets about the SQL-Statement CPAN distribution.

Report information
The Basics
Id: 86214
Status: resolved
Priority: 0/
Queue: SQL-Statement

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Difficulties writing a new dialect
While answering a question on Stack Overflow about how to make SQL::Statement understand an Oracle dialect, I found it very difficult to puzzle out how to extend SQL.  While the option to issue SQL commands is straight forward, it does not scale. 

Information about how to write a subclass is scant and does not answer the question of how to add to the SQL dialect.

There's little documentation on extending an existing dialect.  I dug into the code and found get_config_from_hash could be extended (rather than the documented get_config) but could not puzzle out how to add a function like LENGTH().

See my answer on SO for details.  http://stackoverflow.com/a/17155334/14660
RT-Send-CC: dbi-dev [...] perl.org
On Mon Jun 17 17:47:43 2013, MSCHWERN wrote: Show quoted text
> While answering a question on Stack Overflow about how to make > SQL::Statement > understand an Oracle dialect, I found it very difficult to puzzle out > how to > extend SQL. While the option to issue SQL commands is straight > forward, it does > not scale.
Because it's not designed to be. I always wanted to create such a thing for Perl6 - but ... you know ... missing tuit's, insufficient spare time, no business case - choose one ;) Show quoted text
> Information about how to write a subclass is scant and does not answer > the > question of how to add to the SQL dialect.
Indeed - even if the documentation at http://search.cpan.org/dist/SQL-Statement/lib/SQL/Parser.pm#dialect%28%29 is not as bad as you pretend. But don't discuss RT#86213 here, I'm annoyed enough about opening random tickets instead of asking at dbi-dev@ or dbi-users@ as documentation (you refer - because you read it entirely otherwise you can't decide what is missing) suggest for such cases. Show quoted text
> There's little documentation on extending an existing dialect. I dug > into the > code and found get_config_from_hash could be extended (rather than the > documented get_config) but could not puzzle out how to add a function > like > LENGTH().
Well - the functiom get_config_from_hash is introduced by yourself (see #53128). Please blame the responsible one ;) Show quoted text
> See my answer on SO for details. > http://stackoverflow.com/a/17155334/14660
Your answer there is absolutely correct. And the is no intention to hurry with a newly written SQL::Parser (you're invited to do - but please on at least the quality the new code in SQL::Statement, DBI::DBD::SqlEngine & Co. have - neither the get_config_from_hash nor 1.15 and below are a reference). BTW: I don't know what this ticket was good for. I assume it was a question and I hope the question is answered and the ticket can be closed. Otherwise, please feel free to clarify the goal of the ticket. Cheers Jens
On Tue Jun 18 01:10:05 2013, REHSACK wrote:
Show quoted text
> BTW: I don't know what this ticket was good for. I assume it was a
> question and I hope the question is answered and the ticket can be
> closed. Otherwise, please feel free to clarify the goal of the
> ticket.

I opened this ticket because a user of SQL::Statement was having trouble extending a dialect, I was helping out but couldn't figure out a good answer to their question, and I thought you might like to know about it so you can choose what to do with it.
On Tue Jun 18 16:56:37 2013, MSCHWERN wrote: Show quoted text
> On Tue Jun 18 01:10:05 2013, REHSACK wrote:
> > BTW: I don't know what this ticket was good for. I assume it was a > > question and I hope the question is answered and the ticket can be > > closed. Otherwise, please feel free to clarify the goal of the > > ticket.
> > I opened this ticket because a user of SQL::Statement was having > trouble > extending a dialect, I was helping out but couldn't figure out a good > answer to > their question, and I thought you might like to know about it so you > can choose > what to do with it.
That is a noble task - but please don't repeat. Give a hungry one a fish and you help him over the day - teach him how to fish and you help him for life. Tell them to read the manual - primarily the support section, where it's described where which kind of help is offered. dbi-users@ are really helpful for such kind of questions.
I think, questions are answered.