 
   insert_record = fn(name, insert_cmd) ->
     output = run_script.("""
-    CONNECT remote:localhost/MarcoPoloTest admin admin;
+    CONNECT remote:localhost/MarcoPoloTest #{user} #{pass};
     #{insert_cmd}
     """)
 

  ]

  defmodule TestHelpers do
    def user,     do: System.get_env("ORIENTDB_USER")
    def password, do: System.get_env("ORIENTDB_PASS")

    def cluster_id(name) do
      {_, id} = List.keyfind(unquote(Macro.escape(clusters)), name, 0)


  run_script.("""
  SET ignoreErrors true;
  DROP DATABASE remote:localhost/MarcoPoloTest #{user} #{pass};
  DROP DATABASE remote:localhost/MarcoPoloTestGenerated #{user} #{pass};
  DROP DATABASE remote:localhost/MarcoPoloToDrop #{user} #{pass};
  SET ignoreErrors false;

  CREATE DATABASE remote:localhost/MarcoPoloTest #{user} #{pass} plocal;
  CREATE DATABASE remote:localhost/MarcoPoloToDrop #{user} #{pass} memory;
  """)

  output = run_script.("""
  CONNECT remote:localhost/MarcoPoloTest #{user} #{pass};
  CREATE CLUSTER schemaless ID 999;
  CREATE CLASS Schemaless CLUSTER 999;
  """)

  clusters = [{"schemaless", extract_cluster_id.(output)}|clusters]

  output = run_script.("""
  CONNECT remote:localhost/MarcoPoloTest #{user} #{pass};
  CREATE CLUSTER schemaful ID 1001;
  CREATE CLASS Schemaful;
  CREATE PROPERTY Schemaful.myString STRING;
  """)
