You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a component that can record queries to Quidem files and play them back.
Here is an example:
// The first recorder, in record mode, creates "foo.iq".
ConnectionFactory postgres;
Config config = Config.empty()
.withFile("foo.iq")
.withMode(RECORD)
.withConnectionFactory(postgres);
Recorder recorder = Recorder.create(config);
recorder.executeQuery("select count(*) from emp", "empCount", result -> {
assertThat(result.getMetaData().getColumnCount(), is(1));
assertThat(result.next(), is(true));
assertThat(result.getInt(1), is(13));
});
recorder.close();
// The second recorder, in play mode, reads "foo.iq" created by the first step.
Config config2 = Config.empty()
.withFile("foo.iq")
.withMode(PLAY);
Recorder recorder2 = Recorder.create(config);
recorder.executeQuery("select count(*) from emp", result -> {
assertThat(result.getMetaData().getColumnCount(), is(1));
assertThat(result.next(), is(true));
assertThat(result.getInt(1), is(13));
});
recorder2.close();
Here is the foo.iq file that is generated in step 1 and read in step 2:
!use "postgres"
# empCount
select count(*) as c from emp;
c:int
======
13
!ok
The text was updated successfully, but these errors were encountered:
Add a component that can record queries to Quidem files and play them back.
Here is an example:
Here is the
foo.iq
file that is generated in step 1 and read in step 2:The text was updated successfully, but these errors were encountered: