Skip to content

Commit

Permalink
fix(202): RemoteQuery should not SELECT * (#203)
Browse files Browse the repository at this point in the history
Fixes #202.

Because SELECT * is ambiguous if the query is a join

## Description of Changes

Bug Fix

Previously `RemoteQuery` would implicitly `SELECT *`. This was wrong
because you can use `RemoteQuery` to issue join queries.

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: v1.0.0-rc1

## Testing
*Write instructions for a test that you performed for this PR*

- [ ] Describe a test for this PR that you have completed
  • Loading branch information
joshua-spacetime authored Jan 6, 2025
1 parent 2ed7b8f commit b35379c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ bool IRemoteTableHandle.DeleteEntry(byte[] rowBytes)
protected IEnumerable<Row> Query(Func<Row, bool> filter) => Iter().Where(filter);

public Task<Row[]> RemoteQuery(string query) =>
conn!.RemoteQuery<Row>($"SELECT * FROM {name!} {query}");
conn!.RemoteQuery<Row>($"SELECT {name!}.* FROM {name!} {query}");

void IRemoteTableHandle.InvokeInsert(IEventContext context, IDatabaseRow row) =>
OnInsert?.Invoke((EventContext)context, (Row)row);
Expand Down

0 comments on commit b35379c

Please sign in to comment.