//
//
// PL/.NET (pldotnet) - PostgreSQL support for .NET C# and F# as
// procedural languages (PL)
//
//
// Copyright (c) 2023 Brick Abode
//
// This code is subject to the terms of the PostgreSQL License.
// The full text of the license can be found in the LICENSE file
// at the top level of the pldotnet repository.
//
//
using System;
namespace PlDotNET.Common
{
///
/// Represents the supported .NET programming languages in the PlDotNET context.
///
public enum DotNETLanguage : ushort
{
///
/// Represents the C# language.
///
CSharp,
///
/// Represents the F# language.
///
FSharp,
///
/// Represents the Visual Basic language.
///
VisualBasic,
}
///
/// Defines the modes of function calls in the PlDotNET system.
///
public enum CallMode
{
///
/// Indicates a normal, non-set-returning function (SRF) call.
///
[System.ComponentModel.Description("CALL_NORMAL")]
Normal = 1,
///
/// Indicates the first call to a set-returning function (SRF); this is used to create and cache the function.
///
[System.ComponentModel.Description("CALL_SRF_FIRST")]
SrfFirst = 2,
///
/// Indicates a subsequent call to a set-returning function (SRF).
///
[System.ComponentModel.Description("CALL_SRF_NEXT")]
SrfNext = 3,
///
/// Indicates that the set-returning function (SRF) is done and can be removed from the cache.
///
[System.ComponentModel.Description("CALL_SRF_CLEANUP")]
SrfCleanup = 4,
///
/// Indicates that is calling a trigger.
///
[System.ComponentModel.Description("CALL_TRIGGER")]
Trigger = 5,
}
///
/// Defines the modes of return values from functions in the PlDotNET system.
///
public enum ReturnMode
{
///
/// Indicates that an error was encountered during the function execution.
///
[System.ComponentModel.Description("RETURN_ERROR")]
Error = 0,
///
/// Indicates a normal return from a non-set-returning function call.
///
[System.ComponentModel.Description("RETURN_NORMAL")]
Normal = 1,
///
/// Indicates a return from a set-returning function (SRF) with more values to follow.
///
[System.ComponentModel.Description("RETURN_SRF_NEXT")]
SrfNext = 2,
///
/// Indicates that a set-returning function (SRF) has no more values to return.
///
[System.ComponentModel.Description("RETURN_SRF_DONE")]
SrfDone = 3,
///
/// Indicates that the trigger event should be abort.
///
[System.ComponentModel.Description("RETURN_TRIGGER_SKIP")]
TriggerSkip = 4,
///
/// Indicates that the row has been modified.
///
[System.ComponentModel.Description("RETURN_TRIGGER_MODIFY")]
TriggerModify = 5,
}
}