public void derive_function_with_periods_in_the_name() { var func = new TransformFunction(new StoreOptions(), "nfl.team.chiefs", "module.exports = function(doc){return doc;};"); func.Function.Name.ShouldBe("mt_transform_nfl_team_chiefs"); }
public void derive_function_name_from_logical_name() { var func = new TransformFunction(new StoreOptions(), "something", "module.exports = function(doc){return doc;};"); func.Function.Name.ShouldBe("mt_transform_something"); }
public PatchOperation(TransformFunction transform, IQueryableDocument document, IWhereFragment fragment, IDictionary<string, object> patch) { _transform = transform; _document = document; _fragment = fragment; _patch = patch; }
public void LoadFile(string file, string name = null) { if (!Path.IsPathRooted(file)) { file = AppContext.BaseDirectory.AppendPath(file); } var function = TransformFunction.ForFile(_options, file, name); _functions.Add(function.Name, function); }
public void LoadFile(string file, string name = null) { assertAvailable(); if (!Path.IsPathRooted(file)) { file = AppContext.BaseDirectory.AppendPath(file); } var function = TransformFunction.ForFile(_options, file, name); AddFunction(function); }
public void picks_up_the_schema_from_storeoptions() { var options = new StoreOptions { DatabaseSchemaName = "other" }; var func = new TransformFunction(options, "nfl.team.chiefs", "module.exports = function(doc){return doc;};"); func.Function.Schema.ShouldBe("other"); }
private static string toBasicSql(IDocumentMapping mapping, TransformFunction transform) { var version = CombGuidIdGeneration.NewGuid(); return($"update {mapping.Table.QualifiedName} as d set data = {transform.Function.QualifiedName}(data), {DocumentMapping.LastModifiedColumn} = (now() at time zone 'utc'), {DocumentMapping.VersionColumn} = '{version}'"); }
public DocumentTransformOperationFragment(IDocumentStorage storage, TransformFunction function) { _storage = storage; _function = function; }
private static void writeBasicSql(CommandBuilder sql, IDocumentMapping mapping, TransformFunction transform) { var version = CombGuidIdGeneration.NewGuid(); sql.Append("update "); sql.Append(mapping.Table.QualifiedName); sql.Append(" as d set data = "); sql.Append(transform.Identifier.QualifiedName); sql.Append("(data), "); sql.Append(DocumentMapping.LastModifiedColumn); sql.Append(" = (now() at time zone 'utc'), "); sql.Append(DocumentMapping.VersionColumn); sql.Append(" = '"); sql.Append(version); sql.Append("'"); }
public TransformToJsonSelector(string dataLocator, TransformFunction transform, IQueryableDocument document) { _document = document; _fieldName = $"{transform.Function.QualifiedName}({dataLocator}) as json"; }
public void LoadJavascript(string name, string script) { var func = new TransformFunction(_options, name, script); _functions.Add(func.Name, func); }
public void Load(TransformFunction function) { _functions.Add(function.Name, function); }
public TransformToTypeSelector(string dataLocator, TransformFunction transform, IQueryableDocument document) { _document = document; _fieldName = $"{transform.Identifier}({dataLocator}) as json"; }
public DocumentTransformOperationFragment(IDocumentMapping mapping, TransformFunction function) { _mapping = mapping; _function = function; }
private static string toBasicSql(IDocumentMapping mapping, TransformFunction transform) { return($"update {mapping.Table.QualifiedName} as d set data = {transform.Function.QualifiedName}(data), {DocumentMapping.LastModifiedColumn} = (now() at time zone 'utc')"); }
public void Load(TransformFunction function) { assertAvailable(); AddFunction(function); }
public void Load(TransformFunction function) { _functions.Add(function.Name, function); }
public void LoadJavascript(string name, string script) { var func = new TransformFunction(_options, name, script); _functions.Add(func.Name, func); }
public void LoadFile(string file, string name = null) { var function = TransformFunction.ForFile(_options, file, name); _functions.Add(function.Name, function); }
public TransformToJsonSelector(TransformFunction transform, IQueryableDocument document) { _document = document; _fieldName = $"{transform.Function.QualifiedName}(d.data) as json"; }
public void Load(TransformFunction function) { assertAvailable(); _functions.Add(function.Name, function); }