tursodatabase/turso · error · ArgumentException
Only input parameters are supported
Error message
Only input parameters are supported
What it means
TursoParameter.Direction only ever returns ParameterDirection.Input, and the setter throws ArgumentException for any other value (Output, InputOutput, ReturnValue). Turso's statement protocol binds values client-to-server only; it has no output-parameter mechanism, so requesting one is rejected immediately rather than silently ignored.
Source
Thrown at bindings/dotnet/src/Turso.Data/TursoParameter.cs:75
DbType = dbType;
Value = value;
}
public override void ResetDbType()
{
DbType = DbType.String;
}
public override DbType DbType { get; set; } = DbType.String;
public override ParameterDirection Direction
{
get => ParameterDirection.Input;
set
{
if (value != ParameterDirection.Input)
{
throw new ArgumentException("Only input parameters are supported");
}
}
}
public override bool IsNullable { get; set; }
[AllowNull]
public override string ParameterName { get; set; } = "";
[AllowNull]
public override string SourceColumn { get; set; } = "";
public override object? Value { get; set; }
public override bool SourceColumnNullMapping { get; set; }
public TursoValue ToValue()
{
if (Value is null)
return new TursoValue { ValueType = TursoValueType.Null };
var value = Value;View on GitHub (pinned to 6c72522679)
Solutions
- Remove the Direction assignment — Input is already the default.
- Restructure code that relied on OUT parameters: use SELECT to return values and read them with a reader (or use ExecuteScalar).
- If a shared helper sets Direction, gate it: only assign when the value is ParameterDirection.Input, or skip Turso commands.
Example fix
// before
var p = new TursoParameter("@newId", 0) { Direction = ParameterDirection.Output };
// after
var p = new TursoParameter("@newId", 0); // direction stays Input; read results via SELECT instead Defensive patterns
Strategy: validation
Validate before calling
if (parameter.Direction != ParameterDirection.Input)
throw new NotSupportedException("Turso supports input parameters only; return data via SELECT."); Prevention
- In provider-agnostic helpers, skip assigning Direction for Turso rather than setting it unconditionally.
- Refactor OUT-parameter patterns to SELECT-based returns before migrating to Turso.
When it happens
Trigger: Setting 'parameter.Direction = ParameterDirection.Output' (or InputOutput/ReturnValue) on a TursoParameter; ORMs or generic ADO.NET helpers that set Direction on every parameter; code ported from SQL Server stored-procedure call sites.
Common situations: Migrating stored-procedure-based code that used OUTPUT parameters; Dapper/EF-style helpers that probe directions; copy-pasted command wrappers that set Direction explicitly.
Related errors
- Parameter {value} not found
- Parameter {parameterName} not found
- Parameter {value} is not a TursoParameter
- Parameter type {valueType} is not supported
- Embedded replica sync is not supported yet by the .NET provi
AI-assisted analysis of tursodatabase/turso@6c72522679 (2026-08-20).
Data as JSON: /api/errors/05bfe096338551ca.
Report an issue: GitHub.