Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'length' keyword is not supported as an alias name on the client #234

Open
giovannibenussi opened this issue Jul 1, 2024 · 0 comments
Open

Comments

@giovannibenussi
Copy link
Contributor

As mentioned in this discord thread, using length as an alias name doesn't return any results:

// query: select count(*) as 'length' from my_table
ResultSetImpl {
  columns: [ "length" ],
  columnTypes: [ "" ],
  rows: [ {} ],
  rowsAffected: 0,
  lastInsertRowid: undefined
}

// query: select url as 'length' from my_table
ResultSetImpl {
  columns: [ "length" ],
  columnTypes: [ "TEXT" ],
  rows: [ {}, {} ],
  rowsAffected: 0,
  lastInsertRowid: undefined
}

However, the code works when using an alias name other than length:

// query: select count(*) as 'test' from my_table
ResultSetImpl {
  columns: [ "test" ],
  columnTypes: [ "" ],
  rows: [ { test: 2 } ],
  rowsAffected: 0,
  lastInsertRowid: undefined
}

// query: select url as 'test' from my_table
ResultSetImpl {
  columns: [ "test" ],
  columnTypes: [ "TEXT" ],
  rows: [ { test: "https://example.com" }, { test: "https://example.org" } ],
  rowsAffected: 0,
  lastInsertRowid: undefined
}

Using the length name as an alias works on the Turso shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant