Commit ca570cec authored by François Perrad's avatar François Perrad

condition SQL trace

parent 606f38d8
......@@ -57,7 +57,9 @@ function connection (class)
end
local function execute (class, sql)
_G.print('#', sql)
if trace then
trace('#', sql)
end
local conn = cnx[drv[class]]
if not conn then
error("No connection for class " .. class._NAME)
......
......@@ -18,6 +18,7 @@ sql_create = [[
require 'Test.More'
plan(19)
Coat.Persistent.trace = print
if os.getenv "GEN_PNG" and os.execute "dot -V" == 0 then
local f = io.popen("dot -T png -o 001.png", 'w')
......
......@@ -48,6 +48,7 @@ Person.has_many.Car = {} -- avoid circular definition
require 'Test.More'
plan(16)
Coat.Persistent.trace = print
if os.getenv "GEN_PNG" and os.execute "dot -V" == 0 then
local f = io.popen("dot -T png -o 002.png", 'w')
......
......@@ -18,6 +18,7 @@ sql_create = [[
require 'Test.More'
plan(9)
Coat.Persistent.trace = print
if os.getenv "GEN_PNG" and os.execute "dot -V" == 0 then
local f = io.popen("dot -T png -o 005.png", 'w')
......
......@@ -18,6 +18,7 @@ sql_create = [[
require 'Test.More'
plan(9)
Coat.Persistent.trace = print
if os.getenv "GEN_PNG" and os.execute "dot -V" == 0 then
local f = io.popen("dot -T png -o 006.png", 'w')
......
......@@ -24,6 +24,7 @@ sql_create = [[
require 'Test.More'
plan(2)
Coat.Persistent.trace = print
if os.getenv "GEN_PNG" and os.execute "dot -V" == 0 then
local f = io.popen("dot -T png -o 007.png", 'w')
......
......@@ -18,6 +18,7 @@ sql_create = [[
require 'Test.More'
plan(3)
Coat.Persistent.trace = print
if os.getenv "GEN_PNG" and os.execute "dot -V" == 0 then
local f = io.popen("dot -T png -o 009.png", 'w')
......
......@@ -18,6 +18,7 @@ sql_create = [[
require 'Test.More'
plan(5)
Coat.Persistent.trace = print
if os.getenv "GEN_PNG" and os.execute "dot -V" == 0 then
local f = io.popen("dot -T png -o 010.png", 'w')
......
......@@ -18,6 +18,7 @@ sql_create = [[
require 'Test.More'
plan(5)
Coat.Persistent.trace = print
if os.getenv "GEN_PNG" and os.execute "dot -V" == 0 then
local f = io.popen("dot -T png -o 011.png", 'w')
......
......@@ -52,6 +52,7 @@ Person.has_many.amigos = { class_name = 'Friend' }
require 'Test.More'
plan(12)
Coat.Persistent.trace = print
if os.getenv "GEN_PNG" and os.execute "dot -V" == 0 then
local f = io.popen("dot -T png -o 016.png", 'w')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment