progaudi / progaudi.tarantool

.net connector for Tarantool NoSql database.
MIT License
48 stars 16 forks source link

Box.Eval Parameters #132

Closed MGEHub closed 6 years ago

MGEHub commented 6 years ago

How a parameter will be defined in Box.Eval<> expression?

aensidhe commented 6 years ago

Will this help?

MGEHub commented 6 years ago

Not really, I meant in .net client

MGEHub commented 6 years ago

The real issue is that how an object with a byte array member could be used as parameter in Box.Eval method?

aensidhe commented 6 years ago

Nothing specific: https://github.com/progaudi/progaudi.tarantool/blob/master/tests/progaudi.tarantool.tests/Box/Eval_Should.cs#L18

MGEHub commented 6 years ago

Assuming this:

var result = _box.Eval<InputType, string>( @" box.begin()

                            someFunction(1, 'test', {{ input }})
                            someOtherFunction()

                            box.commit()

                            ", input);

How the input parameter can be referenced in the expression?

MGEHub commented 6 years ago

And in this test:

[Fact] public async Task evaluate_expression() { using (var tarantoolClient = await Client.Box.Connect(ConnectionStringFactory.GetReplicationSource_1_7())) { var result = await tarantoolClient.Eval<TarantoolTuple<int, int, int>, int>("return ...", TarantoolTuple.Create(1, 2, 3));

            result.Data.ShouldBe(new[] {1, 2, 3});
        }

}

the result has to be int not TarantoolTuple. at least in my version.