mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-12-26 16:26:38 +01:00
added marr.datamapper source code for easy debugging.
This commit is contained in:
36
Marr.Data/QGen/Dialects/OracleDialect.cs
Normal file
36
Marr.Data/QGen/Dialects/OracleDialect.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Marr.Data.QGen.Dialects
|
||||
{
|
||||
public class OracleDialect : Dialect
|
||||
{
|
||||
public override string CreateToken(string token)
|
||||
{
|
||||
if (string.IsNullOrEmpty(token))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
string[] parts = token.Replace('[', new Char()).Replace(']', new Char()).Split('.');
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (string part in parts)
|
||||
{
|
||||
if (sb.Length > 0)
|
||||
sb.Append(".");
|
||||
|
||||
bool hasSpaces = part.Contains(' ');
|
||||
|
||||
if (hasSpaces)
|
||||
sb.Append("[").Append(part).Append("]");
|
||||
else
|
||||
sb.Append(part);
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user