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

Read only transaction error message is wrong #8454

Open
fmoor opened this issue Mar 7, 2025 · 0 comments
Open

Read only transaction error message is wrong #8454

fmoor opened this issue Mar 7, 2025 · 0 comments
Labels

Comments

@fmoor
Copy link
Member

fmoor commented Mar 7, 2025

  • EdgeDB Version: 6.2 & 7.0-dev.9399
  • OS Version: ubuntu 22.04.1

The read only transaction error says SELECT, but it seems it should say INSERT.

Steps to Reproduce:

opts := gelcfg.NewTxOptions().WithReadOnly(true)
configured := client.WithTxOptions(opts)

err := configured.Tx(ctx, func(ctx context.Context, tx geltypes.Tx) error {
	return tx.Execute(ctx, "INSERT User")
})
fmt.Println(err)
// Output:
// gel.TransactionError: cannot execute SELECT in a read-only transaction

Schema:

START MIGRATION TO {
	module default {
		global used_everywhere: int64;
		type User {}
	}
};
POPULATE MIGRATION;
COMMIT MIGRATION;
@fmoor fmoor added the compiler label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant