spacetimedb 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -6279,7 +6279,10 @@ function tablesToSchema(ctx, tables) {
6279
6279
  function tableToSchema(accName, schema2, tableDef) {
6280
6280
  const getColName = (i) => schema2.rowType.algebraicType.value.elements[i].name;
6281
6281
  return {
6282
- sourceName: accName,
6282
+ // For client,`schama.tableName` will always be there as canonical name.
6283
+ // For module, if explicit name is not provided via `name`, accessor name will
6284
+ // be used, it is stored as alias in database, hence works in query builder.
6285
+ sourceName: schema2.tableName || accName,
6283
6286
  accessorName: accName,
6284
6287
  columns: schema2.rowType.row,
6285
6288
  // typed as T[i]['rowType']['row'] under TablesToSchema<T>