+(defgeneric database-add-autoincrement-sequence (class database)
+ (:method (class database) nil)
+ (:documentation "If a database needs to add a sequence for its
+ autoincrement to work, this is where it should go. Default is
+ that it doesnt so just return nil"))
+(defgeneric database-remove-autoincrement-sequence (class database)
+ (:method (class database) nil)
+ (:documentation "If a database needs to add a sequence for its
+ autoincrement to work, this is where it should go. Default is
+ that it doesnt so just return nil"))
+(defgeneric auto-increment-sequence-name (class slotdef database)
+ (:documentation "The sequence name to create for this autoincremnt column on this class
+ if returns nil, there is no associated sequence "))
+
+(defmethod auto-increment-sequence-name :around (class slot database)
+ (when (auto-increment-column-p slot database)
+ (call-next-method)))
+
+(defgeneric database-last-auto-increment-id (database table column)
+ )
+
+
+
+;; Generation of SQL strings from lisp expressions
+
+(defgeneric output-sql (expr database)
+ (:documentation "Writes an SQL string appropriate for DATABASE
+ and corresponding to the lisp expression EXPR to
+ *SQL-STREAM*. The function SQL-OUTPUT is a top-level call for
+ generating SQL strings which initialises *SQL-STREAM*, calls
+ OUTPUT-SQL and reads the generated SQL string from
+ *SQL-STREAM*."))
+
+(defgeneric database-output-sql (expr database)
+ (:documentation "Returns an SQL string appropriate for DATABASE
+ and corresponding to the lisp expression
+ EXPR. DATABASE-OUTPUT-SQL is called by OUTPUT-SQL when no more
+ specific method exists for EXPR."))
+
+(defgeneric output-sql-hash-key (expr database)
+ (:documentation "Returns a list (or other object suitable for
+use as the key of an EQUAL hash table) which uniquely identifies
+the arguments EXPR and DATABASE."))
+
+(defgeneric collect-table-refs (sql)
+ )
+
+(defgeneric database-constraint-statement (constraints database)
+ )
+
+(defgeneric database-translate-constraint (constraint database)
+ (:documentation "Given a column constraint returns its
+database-specific name. For example, auto-increment constraints can
+have different names in different database engines."))
+
+(defgeneric filter-select-list ( view-class clsql-sys::select-list database)
+ (:documentation
+ "Gives fine grained control over sql to be executed and mapped to slots
+ called with a dummy instance (so that class precedence can be used)")
+ )