public TableReference(TableOrViewName ti) : this() { InitializeMembers(); InterpretTableOrViewName(ti); }
public static TableOrViewName Create(TableReference tr) { var res = new TableOrViewName(); res.tableReference = tr; return res; }
private void InterpretTableOrViewName(TableOrViewName ti) { var ds = ti.FindDescendant<DatasetName>(); datasetName = (ds != null) ? Util.RemoveIdentifierQuotes(ds.Value) : null; var dbn = ti.FindDescendant<DatabaseName>(); databaseName = (dbn != null) ? Util.RemoveIdentifierQuotes(dbn.Value) : null; var sn = ti.FindDescendant<SchemaName>(); schemaName = (sn != null) ? Util.RemoveIdentifierQuotes(sn.Value) : null; var tn = ti.FindDescendant<TableName>(); databaseObjectName = (tn != null) ? Util.RemoveIdentifierQuotes(tn.Value) : null; isTableOrView = true; }
private void InitializeMembers() { this.tableName = null; }
public override Node Interpret() { this.tableName = FindDescendant<TableOrViewName>(); return base.Interpret(); }
public abstract bool WriteTableOrViewName(TableOrViewName node);
/// <summary> /// /// </summary> /// <param name="node"></param> /// <returns></returns> /// <remarks> /// Table names are only written by this function when the /// table appears in the FROM clause. In all other cases it's /// WriteColumnIdentifier that generates the output /// </remarks> public void WriteTableOrViewName(TableOrViewName node) { if (resolveNames) { Writer.Write(GetResolvedTableName(node.TableReference)); } else { // Fall back to original behavior base.WriteNode(node); } }