     name_string = to_string(flag_name)
     query = from(r in Record, where: r.flag_name == ^name_string)
     try do
-      results = @repo.all(query)
+      results = ecto_repo().all(query)
       flag = deserialize(flag_name, results)
       {:ok, flag}
     rescue


  defp postgres_table_lock! do
    Ecto.Adapters.SQL.query!(
      @repo,
      "LOCK TABLE #{@table_name} IN SHARE ROW EXCLUSIVE MODE;"
    )
  end

    )

    try do
      {_count, _} = ecto_repo().delete_all(query)
      {:ok, flag} = get(flag_name)
      {:ok, flag}
    rescue
