---
title: Vetting Preferences Entity Relationships
---
erDiagram
Property 1--0+ PropertyTenant : prefers
PropertyTenant {
I hereby claim:
- I am bahulneel on github.
- I am bahulneel (https://keybase.io/bahulneel) on keybase.
- I have a public key ASBoanAStRexJFUVJy0Fn5nlg8N-16hKzUT8YN-MZk3f1wo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def conn (d/create-conn {})) | |
(def data | |
[{:a 1 :b 2} | |
{:a 2 :b 3 :c true}]) | |
(d/transact! conn data) | |
(defn not-join | |
[db q vars where] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(->> eid | |
(d/q '[:find ?an ?v ?cn | |
:in $ ?e | |
:where | |
[?e ?a ?v] | |
[?a :db/ident ?an] | |
[?a :db/cardinality ?c] | |
[?c :db/ident ?cn]] | |
db) | |
(reduce (fn [m [k v c]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn wrap-save-content [handler content-type] | |
(fn [request] | |
(if (= content-type (get-in request [:headers "Content-Type"])) | |
(let [temp-file (clojure.java.io/file ...)] | |
(copy (:body request) temp-file) | |
(handler (assoc request :body temp-file))) | |
(handler request)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function removeVars($sql) | |
{ | |
$sql = preg_replace('/(\b)\d+(\b)/', '\1?\2', $sql); | |
$sql = str_replace('?, ', '', $sql); | |
$sql = str_replace("\t", ' ', $sql); | |
return $sql; | |
} |