<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta name="Generator" content="Zarafa WebAccess v6.20.4-14107">
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<title>Convenience over extensibility? Or: How to build on top of hu.dwim.rdbms?</title>
<style type="text/css">
body
{
font-family: Arial, Verdana, Sans-Serif;
font-size: 12px;
padding: 5px 5px 5px 5px;
margin: 0px;
border-style: none;
background-color: #ffffff;
}
p, ul, li
{
margin-top: 0px;
margin-bottom: 0px;
}
</style>
</head>
<body>
<p>Hi<br /><br />While the sql reader syntax e.g. [select * table] is convenient for humans<br />it doesn't allow for being used by other functions or does it?<br /><br />In my opinion such a sql reader syntax is nice to have but not being able to extend the software<br />through the use of functions is disastrous in my eyes. I have the feeling that we create two camps here, one the developers<br />and the other the users. Personally I don't like that distinction and would much prefer to make the possibility of extending<br />the software through the use of functions as easy as possible for the so called "user".<br /><br />With that in mind I find myself using internal function and classes from the hu.dwim.rdbms package<br />( e.g. sql-and, sql-sequence-nextval-column, sql-identifier, sql-all-columns, sql-= )<br />and writing wrapper functions for it e.g.<br /><br />(defun sqlid (name)<br /> (hu.dwim.rdbms::sql-identifier :name (string-upcase name)))<br /><br />(defun sqleq (left right)<br /> (hu.dwim.rdbms::sql-= left right))<br /><br />(defun sqlallcol ()<br /> (lst (hu.dwim.rdbms::sql-all-columns)))<br /><br />(defun sqlselect-single (tbl keycol-id keycol-val)<br /> (select (sqlallcol) (lst tbl)<br /> :where (sqleq (sqlid keycol-id) keycol-val)))<br /> <br />(defun seqnext-literal (name)<br /> (make-instance<br /> 'hu.dwim.rdbms::sql-sequence-nextval-column<br /> :name (string-upcase name)))<br /><br /><br />What do you think about what I just said. Did I go wrong somewhere?<br />And if the above is really an issue, any ideas as how to handle it?<br /><br />Right now I did create another system and package called hu.dwim.rdbms.oracle.ext for things like the above.<br />(The names above are not carved into stone tablets. I often change my mind before I settle for certain names and yes,<br /> often the wrappers seem unnecessary but I don't want to change the package definition of hu.dwim.rdbms<br /> and/or prefer shorter names.)<br /><br /><br />Regards,<br />chris</p>
!DSPAM:4cd3f8b248581688513886!
</body>
</html>