INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Toolbox to compose ordinary queries as easy as possible"
project: "Visual Eiffel"
revision: "$Revision: 1.1 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: dale
class QUERY_COMPOSER
inherit

DALE_SERVER
end
feature -- Queries:

sql (s: STRING): QUERY
-- create QUERY from the specified string
require
valid_string: s /= void
ensure
well_done: Result /= void

select_ (s, f, w: STRING): SQL_SELECT
-- create typical SQL_SELECT from the specified parts
require
valid_strings: s /= void and then not s.is_empty and f /= void and then not f.is_empty and w /= void
ensure
well_done: Result /= void

insert (i, c: STRING; v: ARRAY [ANY]): SQL_INSERT
-- create typical SQL_INSERT from the specified parts
require
valid_arguments: i /= void and then not i.is_empty and c /= void and v /= void and then v.count > 0
ensure
well_done: Result /= void

update (u: STRING; c: ARRAY [STRING]; v: ARRAY [ANY]; w: STRING): SQL_UPDATE
-- create typical SQL_UPDATE from the specified parts
require
valid_arguments: u /= void and then not u.is_empty and c /= void and then c.count > 0 and v /= void and then v.count = c.count and w /= void
ensure
well_done: Result /= void

delete (d, w: STRING): SQL_DELETE
-- create typical SQL_DELETE from the specified parts
require
valid_string: d /= void and then not d.is_empty and w /= void
ensure
well_done: Result /= void

sql_type (t: INTEGER): DB_TYPE
-- returns database' type definition block; the specified type
-- can be either SQL or Eiffel data type constant
-- this feature is very useful when it is needed to pick up
-- data type in SQL statements, for example in "CREATE TABLE"
-- note: if applicable, a precision and scale are set to their
-- maximum values on this database
require
valid_data_type: valid_type (t) or else valid_sql_type (t)
implemented: false
ensure
well_done: Result /= void

sql_type_with_prec (t, p: INTEGER): DB_TYPE
-- same as 'sql_type' but with the possibility to specify
-- a precision
require
valid_data_type: valid_type (t) or else valid_sql_type (t)
valid_precision: p >= 0
implemented: false
ensure
well_done: Result /= void

sql_type_full (t, p, s: INTEGER): DB_TYPE
-- same as 'sql_type' but with the possibility to specify
-- a precision and scale
require
valid_data_type: valid_type (t) or else valid_sql_type (t)
valid_precision: p >= 0
valid_scale: s >= 0
implemented: false
ensure
well_done: Result /= void
feature -- Validations:

valid_type (t: INTEGER): BOOLEAN
-- ...

valid_sql_type (sqlt: INTEGER): BOOLEAN
-- ...
end -- class QUERY_COMPOSER

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES