fl00r/tarantool-clj-1.7

broken tuple-space/select

middlesphere opened this issue · 2 comments

Hi.

I'm trying to use tarantool-clj-1.7 with Tarantool version 1.7.4-18-g1ed75e6

The following code is not working, cause (space/new-space test-space-config) throws exception.
It looks that get-space-id function in tarantool-clj.space expects collection on line 36 but the line 35 with (tuple-space/select 2 [space-name]) returns clojure.core.async.impl.channels.ManyToManyChannel

So i got CompilerException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core.async.impl.channels.ManyToManyChannel, compiling:(form-init1681439116406955902.clj:29:16)

`(ns tnt01.core
(:gen-class)
(:require [tarantool-clj.client :as client]
[tarantool-clj.space :as space]
[com.stuartsierra.component :as component]))

(defn -main
"I don't do a whole lot ... yet."
[& args]
(println "Hello, World!"))

(def connection-config
{:host "127.0.0.1"
:port 3301
:username "test"
:password "test"})

(def test-space-config
{:name "tester"
:fields [:id :first-name :second-name]
:tail :_tail})

(def client (-> connection-config
(client/new-client)
(component/start)))

(def space (-> client
(space/new-space test-space-config)
(component/start)))

(component/stop client)

;; box.cfg{listen = 3301}
;; s = box.schema.space.create('test')
;; s:create_index('primary', {type = 'hash', parts = {1, 'unsigned'}})
;; t = s:insert({1, 'Roxette'})
;; t = s:insert({2, 'Scorpions', 2015})
;; t = s:insert({3, 'Ace of Base', 1993})

;; box.schema.user.create('test', {password = 'test'})
;; box.schema.user.grant('test', 'read,write,execute', 'universe')
`

i've used wrong db schema. so close issue.

fl00r commented

Hey MIke,
glad you've figured everything out :)