X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=doc%2Fref-fddl.xml;h=5caa87d50ddb0d663c9f83fe49d52935a1dd19f1;hb=18e34efea688a6758b6e997401fbc3f241da98f3;hp=5d542ded1ffdf0b8b92969d71c67d9a63bc108c5;hpb=fdd069770e32d0cfa4b66d6e5cfd4540197660ba;p=clsql.git diff --git a/doc/ref-fddl.xml b/doc/ref-fddl.xml index 5d542de..5caa87d 100644 --- a/doc/ref-fddl.xml +++ b/doc/ref-fddl.xml @@ -24,7 +24,7 @@ CREATE-TABLE - Function CREATE-TABLE + CREATE-TABLE Create a database table. Function @@ -109,6 +109,18 @@ => (table-exists-p [foo]) => T + +(create-table [foo] '(([bar] integer :not-null :unique :primary-key) + ([baz] string :not-null :unique))) +=> +(table-exists-p [foo]) +=> T + +(create-table [foo] '(([bar] integer :not-null) ([baz] string :not-null)) + :constraints '("UNIQUE (bar,baz)" "PRIMARY KEY (bar)")) +=> +(table-exists-p [foo]) +=> T @@ -157,7 +169,7 @@ DROP-TABLE - Function DROP-TABLE + DROP-TABLE Drop a database table. Function @@ -265,7 +277,7 @@ LIST-TABLES - Function LIST-TABLES + LIST-TABLES Returns a list of database tables. Function @@ -371,7 +383,7 @@ TABLE-EXISTS-P - Function TABLE-EXISTS-P + TABLE-EXISTS-P Tests for the existence of a database table. Function @@ -477,7 +489,7 @@ CREATE-VIEW - Function CREATE-VIEW + CREATE-VIEW Create a database view. Function @@ -563,7 +575,7 @@ ("Konstantin" "Chernenko" "chernenko@soviet.org") ("Mikhail" "Gorbachev" "gorbachev@soviet.org") ("Boris" "Yeltsin" "yeltsin@soviet.org") - ("Vladamir" "Putin" "putin@soviet.org")), + ("Vladimir" "Putin" "putin@soviet.org")), ("first_name" "last_name" "email") @@ -609,7 +621,7 @@ DROP-VIEW - Function DROP-VIEW + DROP-VIEW Drops a database view. Function @@ -717,7 +729,7 @@ LIST-VIEWS - Function LIST-VIEWS + LIST-VIEWS Returns a list of database views. Function @@ -824,7 +836,7 @@ VIEW-EXISTS-P - Function VIEW-EXISTS-P + VIEW-EXISTS-P Tests for the existence of a database view. Function @@ -930,7 +942,7 @@ CREATE-INDEX - Function CREATE-INDEX + CREATE-INDEX Create a database index. Function @@ -1052,7 +1064,7 @@ DROP-INDEX - Function DROP-INDEX + DROP-INDEX Drop a database index. Function @@ -1177,7 +1189,7 @@ LIST-INDEXES - Function LIST-INDEXES + LIST-INDEXES Returns a list of database indexes. Function @@ -1295,7 +1307,7 @@ INDEX-EXISTS-P - Function INDEX-EXISTS-P + INDEX-EXISTS- Tests for the existence of a database index. Function @@ -1402,7 +1414,7 @@ ATTRIBUTE-TYPE - Function ATTRIBUTE-TYPE + ATTRIBUTE-TYPE Returns the type of the supplied attribute. Function @@ -1552,7 +1564,7 @@ LIST-ATTRIBUTE-TYPES - Function LIST-ATTRIBUTE-TYPES + LIST-ATTRIBUTE-TYPES Returns information about the attribute types of a table. Function @@ -1668,7 +1680,7 @@ LIST-ATTRIBUTES - Function LIST-ATTRIBUTES + LIST-ATTRIBUTES Returns the attributes of a table as a list. Function @@ -1775,7 +1787,7 @@ CREATE-SEQUENCE - Function CREATE-SEQUENCE + CREATE-SEQUENCE Create a database sequence. Function @@ -1867,7 +1879,7 @@ DROP-SEQUENCE - Function DROP-SEQUENCE + DROP-SEQUENCE Drop a database sequence. Function @@ -1977,7 +1989,7 @@ LIST-SEQUENCES - Function LIST-SEQUENCES + LIST-SEQUENCES Returns a list of database sequences. Function @@ -2078,7 +2090,7 @@ SEQUENCE-EXISTS-P - Function SEQUENCE-EXISTS-P + SEQUENCE-EXISTS-P Tests for the existence of a database sequence. Function @@ -2188,7 +2200,7 @@ SEQUENCE-LAST - Function SEQUENCE-LAST + SEQUENCE-LAST Return the last element in a database sequence. Function @@ -2290,7 +2302,7 @@ SEQUENCE-NEXT - Function SEQUENCE-NEXT + SEQUENCE-NEXT Increment the value of a database sequence. Function @@ -2399,7 +2411,7 @@ SET-SEQUENCE-POSITION - Function SET-SEQUENCE-POSITION + SET-SEQUENCE-POSITION Sets the position of a database sequence. Function @@ -2506,4 +2518,101 @@ + + + TRUNCATE-DATABASE + + + TRUNCATE-DATABASE + Drop all tables, views, indexes and sequences in a database. + Function + + + Syntax + + truncate-database &key database => + + + Arguments and Values + + + database + + A + database + object. This will default to the value + of *default-database*. + + + + + + Description + + Drop all tables, views, indexes and sequences in + database which defaults to + *default-database*. + + + + Examples + +(list-tables) +=> ("type_table" "type_bigint" "employee" "company" "addr" "ea_join" "big") +(list-indexes) +=> ("employeepk" "companypk" "addrpk") +(list-views) +=> ("lenins_group") +(list-sequences) +=> ("foo" "bar") +(truncate-database) +=> +(list-tables) +=> NIL +(list-indexes) +=> NIL +(list-views) +=> NIL +(list-sequences) +=> NIL + + + + Side Effects + + Modifications are made to the underlying database. + + + + Affected by + + None. + + + + Exceptional Situations + + Signals an error of type sql-database-error if + database is not a database object. + + + + See Also + + + drop-table + drop-view + drop-index + drop-sequence + + + + + Notes + + truncate-database is a &clsql; extension. + + + +