Created
July 22, 2024 10:45
-
-
Save Alxandr/90084b68aeef6da5b88e609856aed5ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prereq: schema foo finnes og bruker 1 har lov til aa lage tabeller der, og bruker 2 har ikke men har lov til aa lese | |
{ | |
await using var db = CreateConnection("connstr1"); | |
db.Exec("CREATE TABLE foo.bar (id INT PRIMARY KEY)"); | |
} | |
{ | |
await using var db = CreateConnection("connstr2"); | |
db.Exec("SELECT * FROM foo.bar"); // works | |
db.Exec("CREATE TABLE foo.baz (id INT PRIMARY KEY)"); // throws - no permission | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment