mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
added marr.datamapper source code for easy debugging.
This commit is contained in:
parent
58a05fcef8
commit
3cdff3bb71
96 changed files with 9198 additions and 363 deletions
59
Marr.Data/QGen/Dialects/Dialect.cs
Normal file
59
Marr.Data/QGen/Dialects/Dialect.cs
Normal file
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Marr.Data.QGen.Dialects
|
||||
{
|
||||
public class Dialect
|
||||
{
|
||||
/// <summary>
|
||||
/// The default token is surrounded by brackets.
|
||||
/// </summary>
|
||||
/// <param name="token"></param>
|
||||
public virtual 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(".");
|
||||
|
||||
sb.Append("[").Append(part).Append("]");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public virtual string IdentityQuery
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasIdentityQuery
|
||||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrEmpty(IdentityQuery);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool SupportsBatchQueries
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue