public TextResultSet Query(string query) { var stream = client.GetStream(); var readWriteBuffer = InternalMemoryPool.GetBuffer(); var writer = PacketWriter.Create(readWriteBuffer); ProtocolWriter.WriteQuery(ref writer, query); var reader = SyncWriteAndRead(ref writer, 0, stream); // TODO: Ok or ResultSet? var set = ProtocolReader.ReadTextResultSet(ref reader); return(set); }
public TextResultSet Query(FormattableString query) { if (query.ArgumentCount == 0) { return(Query(query.Format)); } var stream = client.GetStream(); var readWriteBuffer = InternalMemoryPool.GetBuffer(); var writer = PacketWriter.Create(readWriteBuffer); var charBuffer = InternalMemoryPool.GetCharBuffer(); var stringCount = FastQueryParser.Parse(ref charBuffer, query); ProtocolWriter.WriteQuery(ref writer, charBuffer, stringCount); var reader = SyncWriteAndRead(ref writer, 0, stream); // TODO: Ok or ResultSet? var set = ProtocolReader.ReadTextResultSet(ref reader); return(set); }