We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da00012 commit d63560fCopy full SHA for d63560f
MethodSystem/Methods/DatabaseMethods/DBExistsMethod.cs
@@ -0,0 +1,22 @@
1
+using SER.ArgumentSystem.Arguments;
2
+using SER.ArgumentSystem.BaseArguments;
3
+using SER.FileSystem.Structures;
4
+using SER.MethodSystem.BaseMethods;
5
+using SER.ValueSystem;
6
+
7
+namespace SER.MethodSystem.Methods.DatabaseMethods;
8
9
+public class DBExistsMethod : ReturningMethod<BoolValue>
10
+{
11
+ public override string? Description => "Returns true if the provided database exists.";
12
13
+ public override Argument[] ExpectedArguments =>
14
+ [
15
+ new TextArgument("database name")
16
+ ];
17
18
+ public override void Execute()
19
+ {
20
+ ReturnValue = Database.TryGet(Args.GetText("database name")).WasSuccessful();
21
+ }
22
+}
0 commit comments