fixes for ucw+interpreter
[clinton/lisp-on-lines.git] / src / backend / clsql.lisp
index e4e8353..8d593dc 100644 (file)
       (return-from sync-instance))
     (update-records-from-instance view :database database)
     (update-instance-from-records view :database database)
-    (update-objects-joins (list view))))
+    (update-objects-joins (list view)))
+
+  ;; return the modified and hopefully now persistent object
+  view)
 
 
 
@@ -209,7 +212,7 @@ AND fa.attnum = ANY (pg_constraint.confkey)"))
    :set t))
 
 (defun gen-many-to-many (row home-key foreign-key)
- (let ((name (sql->sym (string-upcase (format nil "~A->~A" (string (car row)) (string (second row)))))))
+ (let ((name (sql->sym (string-upcase (format nil "~A<-~A->~A" (string (car row)) (string foreign-key) (string (second row)))))))
    (setf row (mapcar #'sql->sym row))
    `(,name
      :accessor ,name
@@ -276,9 +279,9 @@ creates a clsql view-class"
 (def-compare-expr standard-db-object expr-= sql-=)
 (def-compare-expr standard-db-object expr-< sql-<)        
 (def-compare-expr standard-db-object expr-> sql->)
-(def-compare-expr standard-db-object expr-ends-with sql-like :value-format "%~A")
-(def-compare-expr standard-db-object expr-starts-with sql-like :value-format "~A%")
-(def-compare-expr standard-db-object expr-contains sql-like :value-format "%~A%")
+(def-compare-expr standard-db-object expr-ends-with sql-uplike :value-format "%~A")
+(def-compare-expr standard-db-object expr-starts-with sql-uplike :value-format "~A%")
+(def-compare-expr standard-db-object expr-contains sql-uplike :value-format "%~A%")
 
 (def-logical-expr standard-db-object expr-and #'sql-and)