# Introduction This is a short guide to what hssqlsystem can do. ## Expression types <%Command HsSqlSystem typecheckexpression '"2+2"'%> <%Command HsSqlSystem typecheckexpression '"2+'3'"'%> <%Command HsSqlSystem typecheckexpression '"2||'3'"'%> <%Command HsSqlSystem typecheckexpression '"2+a"'%> <%Command HsSqlSystem typecheckexpression '"noexist(2)"'%> <%Command HsSqlSystem typecheckexpression '"'dsf'||'sadfsdf'"'%> <%Command File SelectExpression.sql (select attname as attribute_name, typname as type_name, relname as relvar_name from pg_attribute inner join pg_class on (attrelid = pg_class.oid) inner join pg_type on (atttypid = pg_type.oid) inner join (select relname as relvar_name from pg_class where relnamespace = (select oid from pg_namespace where nspname = 'public') and relkind = 'r') base_relvars on (relname = base_relvars.relvar_name) where attnum >= 1) %> ; <%Command HsSqlSystem typecheckexpression SelectExpression.sql%> this shouldn't be hint: this needs different command as wrapper to say it's wrapped in wrapET <%Command File Select1.sql select attname as attribute_name, typname as type_name, relname as relvar_name from pg_attribute inner join pg_class on (attrelid = pg_class.oid) inner join pg_type on (atttypid = pg_type.oid) inner join (select relname as relvar_name from pg_class where relnamespace = (select oid from pg_namespace where nspname = 'public') and relkind = 'r') base_relvars on (relname = base_relvars.relvar_name) where attnum >= 1; %> <%Command HsSqlSystem annotatesource -f=Select1.sql%> : annotate source aast ppp dig some big examples out of chaos then with errors ## catalog info <%Command File suppliers_and_parts_ddl.sql create table s ( s_no int primary key, sname text not null, status int not null, city text not null ); create table p ( p_po int primary key, pname text not null, color text not null, weight int not null, city text not null ); create table sp ( s_no int not null references s, p_no int not null references p, qty int not null, primary key (s_no,p_no) );%> <%Command HsSqlSystem ppcatalog -d=template1 suppliers_and_parts_ddl.sql%> show catalog compare catalogs # extensions demonstrate create_var extension + haskell source? # stuff to write which will look good here: function match resolution annotation better pretty printer for type errors better pretty printer for annotations better pretty printer for catalog updates typechecking ? strings reference for commands in hssqlppp with examples for each add sql files for suppliers and parts database? ---- more referency section with each command, a description, plus example usage of each, and examples of all the options, and how to use a config file # ??literatize this file some more: embed these notes into HsSqlSystem.lhs then provide two documentation processes, one to htmlize without the source as a command line users guide, and to htmlize the entire file as a programmers guide: extend this to commands.lhs as the start of a tutorial/ guide for someone using this as a library. -> then the system will allow conversion of HsSqlSystem.lhs to html for: end user guide: how to use the program library user guide: includes source as example code for haskell programmers haddock generated documentation and also to produce an executable. -> need some way to mark which bits are excluded from the end user guide need to be able to pandoc-up the file with syntax highlighting also need to have some system to preprocess the file to run embedded commands and feed the output into the file before it is pandoc'd/syntax highlighted. ~~~~~~~~{.sql} (select attname as attribute_name, typname as type_name, relname as relvar_name from pg_attribute inner join pg_class on (attrelid = pg_class.oid) inner join pg_type on (atttypid = pg_type.oid) inner join base_relvars on (relname = base_relvars.relvar_name) where attnum >= 1) ~~~~~~~~