Skip to content

Commit d63560f

Browse files
Create DBExistsMethod.cs
1 parent da00012 commit d63560f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)