Commit | Line | Data |
---|---|---|
525c4d2a BA |
1 | // ER diagram description parser |
2 | class ErDiags | |
3 | { | |
4 | constructor(description) | |
5 | { | |
4ef6cded BA |
6 | this.entities = { }; |
7 | this.inheritances = [ ]; | |
8 | this.associations = [ ]; | |
19addd10 BA |
9 | this.tables = { }; |
10 | this.mcdParsing(description); | |
11 | this.mldParsing(); | |
525c4d2a BA |
12 | // Cache SVG graphs returned by server (in addition to server cache = good perfs) |
13 | this.mcdGraph = ""; | |
14 | this.mldGraph = ""; | |
15 | this.sqlText = ""; | |
16 | } | |
17 | ||
7a80e6db | 18 | static CARDINAL(symbol) |
525c4d2a | 19 | { |
7a80e6db BA |
20 | let res = { "*": "0,n", "+": "1,n", "?": "0,1", "1": "1,1" } [ symbol[0] ]; |
21 | if (symbol.length >= 2) | |
22 | { | |
23 | if (symbol[1] == 'R') | |
24 | res = '(' + res + ')'; | |
25 | else if (['>','<'].includes(symbol[1])) | |
26 | res += symbol[1]; | |
27 | } | |
28 | return res; | |
525c4d2a BA |
29 | } |
30 | ||
19addd10 BA |
31 | /////////////////////////////// |
32 | // PARSING STAGE 1: text to MCD | |
33 | /////////////////////////////// | |
525c4d2a BA |
34 | |
35 | // Parse a textual description into a json object | |
19addd10 | 36 | mcdParsing(text) |
525c4d2a BA |
37 | { |
38 | let lines = text.split("\n"); | |
39 | lines.push(""); //easier parsing: always empty line at the end | |
40 | let start = -1; | |
41 | for (let i=0; i < lines.length; i++) | |
42 | { | |
43 | lines[i] = lines[i].trim(); | |
44 | // Empty line ? | |
45 | if (lines[i].length == 0) | |
46 | { | |
47 | if (start >= 0) //there is some group of lines to parse | |
48 | { | |
49 | this.parseThing(lines, start, i); | |
50 | start = -1; | |
51 | } | |
52 | } | |
53 | else //not empty line: just register starting point | |
54 | { | |
55 | if (start < 0) | |
56 | start = i; | |
57 | } | |
58 | } | |
59 | } | |
60 | ||
61 | // Parse a group of lines into entity, association, ... | |
62 | parseThing(lines, start, end) //start included, end excluded | |
63 | { | |
64 | switch (lines[start].charAt(0)) | |
65 | { | |
66 | case '[': | |
67 | // Entity = { name: { attributes, [weak] } } | |
006d95a3 | 68 | let name = lines[start].match(/[^\[\]"\s]+/)[0]; |
525c4d2a BA |
69 | let entity = { attributes: this.parseAttributes(lines, start+1, end) }; |
70 | if (lines[start].charAt(1) == '[') | |
71 | entity.weak = true; | |
72 | this.entities[name] = entity; | |
73 | break; | |
74 | case 'i': //inheritance (arrows) | |
75 | this.inheritances = this.inheritances.concat(this.parseInheritance(lines, start+1, end)); | |
76 | break; | |
77 | case '{': //association | |
78 | // Association = { [name], [attributes], [weak], entities: ArrayOf entity indices } | |
79 | let relationship = { }; | |
006d95a3 | 80 | let nameRes = lines[start].match(/[^{}"\s]+/); |
525c4d2a BA |
81 | if (nameRes !== null) |
82 | relationship.name = nameRes[0]; | |
83 | if (lines[start].charAt(1) == '{') | |
84 | relationship.weak = true; | |
85 | this.associations.push(Object.assign({}, relationship, this.parseAssociation(lines, start+1, end))); | |
86 | break; | |
87 | } | |
88 | } | |
89 | ||
90 | // attributes: ArrayOf {name, [isKey], [type], [qualifiers]} | |
91 | parseAttributes(lines, start, end) | |
92 | { | |
5fe4fa10 | 93 | let attributes = [ ]; |
525c4d2a BA |
94 | for (let i=start; i<end; i++) |
95 | { | |
d6c9499e BA |
96 | let field = { }; |
97 | let line = lines[i]; | |
6a430a22 | 98 | if (line.charAt(0) == '+') |
d6c9499e | 99 | { |
525c4d2a | 100 | field.isKey = true; |
d6c9499e BA |
101 | line = line.slice(1); |
102 | } | |
006d95a3 | 103 | field.name = line.match(/[^()"\s]+/)[0]; |
d6c9499e | 104 | let parenthesis = line.match(/\((.+)\)/); |
525c4d2a BA |
105 | if (parenthesis !== null) |
106 | { | |
107 | let sqlClues = parenthesis[1]; | |
19addd10 BA |
108 | field.type = sqlClues.match(/[^\s]+/)[0]; //type is always the first indication (mandatory) |
109 | field.qualifiers = sqlClues.substring(field.type.length).trim(); | |
525c4d2a BA |
110 | } |
111 | attributes.push(field); | |
112 | } | |
113 | return attributes; | |
114 | } | |
115 | ||
116 | // GroupOf Inheritance: { parent, children: ArrayOf entity indices } | |
117 | parseInheritance(lines, start, end) | |
118 | { | |
119 | let inheritance = []; | |
120 | for (let i=start; i<end; i++) | |
121 | { | |
122 | let lineParts = lines[i].split(" "); | |
123 | let children = []; | |
124 | for (let j=1; j<lineParts.length; j++) | |
125 | children.push(lineParts[j]); | |
126 | inheritance.push({ parent:lineParts[0], children: children }); | |
127 | } | |
128 | return inheritance; | |
129 | } | |
130 | ||
c728aeca BA |
131 | // Association (parsed here): { |
132 | // entities: ArrayOf entity names + cardinality, | |
133 | // [attributes: ArrayOf {name, [isKey], [type], [qualifiers]}] | |
134 | // } | |
525c4d2a BA |
135 | parseAssociation(lines, start, end) |
136 | { | |
137 | let assoce = { }; | |
138 | let entities = []; | |
139 | let i = start; | |
140 | while (i < end) | |
141 | { | |
142 | if (lines[i].charAt(0) == '-') | |
143 | { | |
144 | assoce.attributes = this.parseAttributes(lines, i+1, end); | |
145 | break; | |
146 | } | |
147 | else | |
148 | { | |
149 | // Read entity name + cardinality | |
150 | let lineParts = lines[i].split(" "); | |
151 | entities.push({ name:lineParts[0], card:lineParts[1] }); | |
152 | } | |
153 | i++; | |
154 | } | |
155 | assoce.entities = entities; | |
156 | return assoce; | |
157 | } | |
158 | ||
19addd10 BA |
159 | ////////////////////////////// |
160 | // PARSING STAGE 2: MCD to MLD | |
161 | ////////////////////////////// | |
162 | ||
163 | // From entities + relationships to tables | |
164 | mldParsing() | |
165 | { | |
166 | // Pass 1: initialize tables | |
167 | Object.keys(this.entities).forEach( name => { | |
168 | let newTable = [ ]; //array of fields | |
169 | this.entities[name].attributes.forEach( attr => { | |
170 | newTable.push({ | |
171 | name: attr.name, | |
172 | type: attr.type, | |
173 | isKey: attr.isKey, | |
174 | qualifiers: attr.qualifiers, | |
175 | }); | |
176 | }); | |
177 | this.tables[name] = newTable; | |
178 | }); | |
3ca1e50c BA |
179 | // Add foreign keys information for children (inheritance). TODO: allow several levels |
180 | // NOTE: modelisation assume each child has its own table, refering parent (other options exist) | |
181 | this.inheritances.forEach( inh => { | |
182 | let idx = this.tables[inh.parent].findIndex( item => { return item.isKey; }); | |
183 | inh.children.forEach( c => { | |
184 | this.tables[c].push({ | |
185 | name: inh.parent + "_id", | |
186 | type: this.tables[inh.parent][idx].type, | |
187 | isKey: true, | |
188 | qualifiers: (this.tables[inh.parent][idx].qualifiers || "") + " foreign key references " + inh.parent, | |
189 | ref: inh.parent, | |
190 | }); | |
191 | }); | |
192 | }); | |
19addd10 BA |
193 | // Pass 2: parse associations, add foreign keys when cardinality is 0,1 or 1,1 |
194 | this.associations.forEach( a => { | |
195 | let newTableAttrs = [ ]; | |
0133e929 | 196 | let hasZeroOne = false; |
19addd10 BA |
197 | a.entities.forEach( e => { |
198 | if (['?','1'].includes(e.card[0])) | |
199 | { | |
0133e929 | 200 | hasZeroOne = true; |
19addd10 BA |
201 | // Foreign key apparition (for each entity in association minus current one, for each identifying attribute) |
202 | a.entities.forEach( e2 => { | |
203 | if (e2.name == e.name) | |
204 | return; | |
5fe4fa10 | 205 | this.entities[e2.name].attributes.forEach( attr => { |
19addd10 BA |
206 | if (attr.isKey) |
207 | { | |
208 | this.tables[e.name].push({ | |
209 | isKey: e.card.length >= 2 && e.card[1] == 'R', //"weak tables" foreign keys become part of the key | |
3ca1e50c | 210 | name: e2.name + "_" + attr.name, |
19addd10 | 211 | type: attr.type, |
351d7a84 | 212 | qualifiers: "foreign key references " + e2.name + " " + (e.card[0]=='1' ? "not null" : ""), |
19addd10 BA |
213 | ref: e2.name, //easier drawMld function (fewer regexps) |
214 | }); | |
215 | } | |
216 | }); | |
217 | }); | |
218 | } | |
219 | else | |
220 | { | |
221 | // Add all keys in current entity | |
351d7a84 | 222 | let fields = this.entities[e.name].attributes.filter( attr => { return attr.isKey; }); |
19addd10 BA |
223 | newTableAttrs.push({ |
224 | fields: fields, | |
225 | entity: e.name, | |
226 | }); | |
227 | } | |
351d7a84 | 228 | }); |
0133e929 | 229 | if (!hasZeroOne && newTableAttrs.length > 1) |
19addd10 BA |
230 | { |
231 | // Ok, really create a new table | |
232 | let newTable = { | |
351d7a84 | 233 | name: a.name || newTableAttrs.map( item => { return item.entity; }).join("_"), |
19addd10 BA |
234 | fields: [ ], |
235 | }; | |
236 | newTableAttrs.forEach( item => { | |
237 | item.fields.forEach( f => { | |
238 | newTable.fields.push({ | |
239 | name: item.entity + "_" + f.name, | |
240 | isKey: true, | |
351d7a84 | 241 | type: f.type, |
3ca1e50c | 242 | qualifiers: (f.qualifiers || "") + " foreign key references " + item.entity + " not null", |
19addd10 BA |
243 | ref: item.entity, |
244 | }); | |
245 | }); | |
246 | }); | |
7a80e6db BA |
247 | // Check for duplicates (in case of self-relationship), rename if needed |
248 | newTable.fields.forEach( (f,i) => { | |
249 | const idx = newTable.fields.findIndex( item => { return item.name == f.name; }); | |
250 | if (idx < i) | |
251 | { | |
252 | // Current field is a duplicate | |
253 | let suffix = 2; | |
254 | let newName = f.name + suffix; | |
255 | while (newTable.fields.findIndex( item => { return item.name == newName; }) >= 0) | |
256 | { | |
257 | suffix++; | |
258 | newName = f.name + suffix; | |
259 | } | |
260 | f.name = newName; | |
261 | } | |
262 | }); | |
19addd10 | 263 | // Add relationship potential own attributes |
5fe4fa10 | 264 | (a.attributes || [ ]).forEach( attr => { |
19addd10 BA |
265 | newTable.fields.push({ |
266 | name: attr.name, | |
267 | isKey: false, | |
268 | type: attr.type, | |
269 | qualifiers: attr.qualifiers, | |
270 | }); | |
271 | }); | |
272 | this.tables[newTable.name] = newTable.fields; | |
273 | } | |
274 | }); | |
275 | } | |
276 | ||
277 | ///////////////////////////////// | |
278 | // DRAWING + GET SQL FROM PARSING | |
279 | ///////////////////////////////// | |
525c4d2a BA |
280 | |
281 | static AjaxGet(dotInput, callback) | |
282 | { | |
283 | let xhr = new XMLHttpRequest(); | |
284 | xhr.onreadystatechange = function() { | |
285 | if (this.readyState == 4 && this.status == 200) | |
286 | callback(this.responseText); | |
287 | }; | |
288 | xhr.open("GET", "scripts/getGraphSvg.php?dot=" + encodeURIComponent(dotInput), true); | |
289 | xhr.send(); | |
290 | } | |
291 | ||
292 | // "Modèle conceptuel des données". TODO: option for graph size | |
48a55161 | 293 | // NOTE: randomizing helps to obtain better graphs (sometimes) |
525c4d2a BA |
294 | drawMcd(id, mcdStyle) //mcdStyle: bubble, or compact |
295 | { | |
296 | let element = document.getElementById(id); | |
297 | mcdStyle = mcdStyle || "compact"; | |
298 | if (this.mcdGraph.length > 0) | |
299 | { | |
300 | element.innerHTML = this.mcdGraph; | |
301 | return; | |
302 | } | |
303 | // Build dot graph input | |
304 | let mcdDot = 'graph {\n'; | |
48a55161 | 305 | mcdDot += 'rankdir="LR";\n'; |
525c4d2a | 306 | // Nodes: |
48a55161 | 307 | if (mcdStyle == "compact") |
c728aeca | 308 | mcdDot += 'node [shape=plaintext];\n'; |
48a55161 | 309 | _.shuffle(Object.keys(this.entities)).forEach( name => { |
525c4d2a BA |
310 | if (mcdStyle == "bubble") |
311 | { | |
006d95a3 | 312 | mcdDot += '"' + name + '" [shape=rectangle, label="' + name + '"'; |
525c4d2a BA |
313 | if (this.entities[name].weak) |
314 | mcdDot += ', peripheries=2'; | |
315 | mcdDot += '];\n'; | |
316 | if (!!this.entities[name].attributes) | |
317 | { | |
b74cfe41 | 318 | this.entities[name].attributes.forEach( a => { |
525c4d2a | 319 | let label = (a.isKey ? '#' : '') + a.name; |
48a55161 | 320 | let attrName = name + '_' + a.name; |
006d95a3 | 321 | mcdDot += '"' + attrName + '" [shape=ellipse, label="' + label + '"];\n'; |
48a55161 | 322 | if (Math.random() < 0.5) |
006d95a3 | 323 | mcdDot += '"' + attrName + '" -- "' + name + '";\n'; |
48a55161 | 324 | else |
006d95a3 | 325 | mcdDot += '"' + name + '" -- "' + attrName + '";\n'; |
525c4d2a BA |
326 | }); |
327 | } | |
328 | } | |
329 | else | |
330 | { | |
006d95a3 | 331 | mcdDot += '"' + name + '" [label=<'; |
525c4d2a BA |
332 | if (this.entities[name].weak) |
333 | { | |
334 | mcdDot += '<table port="name" BORDER="1" ALIGN="LEFT" CELLPADDING="0" CELLSPACING="3" CELLBORDER="0">' + | |
335 | '<tr><td><table BORDER="1" ALIGN="LEFT" CELLPADDING="5" CELLSPACING="0">\n'; | |
336 | } | |
337 | else | |
338 | mcdDot += '<table port="name" BORDER="1" ALIGN="LEFT" CELLPADDING="5" CELLSPACING="0">\n'; | |
339 | mcdDot += '<tr><td BGCOLOR="#ae7d4e" BORDER="0"><font COLOR="#FFFFFF">' + name + '</font></td></tr>\n'; | |
340 | if (!!this.entities[name].attributes) | |
341 | { | |
b74cfe41 | 342 | this.entities[name].attributes.forEach( a => { |
525c4d2a BA |
343 | let label = (a.isKey ? '<u>' : '') + a.name + (a.isKey ? '</u>' : ''); |
344 | mcdDot += '<tr><td BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >' + label + '</font></td></tr>\n'; | |
345 | }); | |
346 | } | |
347 | mcdDot += '</table>'; | |
348 | if (this.entities[name].weak) | |
349 | mcdDot += '</td></tr></table>'; | |
350 | mcdDot += '>];\n'; | |
351 | } | |
352 | }); | |
353 | // Inheritances: | |
006d95a3 | 354 | _.shuffle(this.inheritances).forEach( i => { |
a2d8ba72 BA |
355 | // TODO: node shape = triangle fill yellow. See |
356 | // https://merise.developpez.com/faq/?page=MCD#CIF-ou-dependance-fonctionnelle-de-A-a-Z | |
357 | // https://merise.developpez.com/faq/?page=MLD#Comment-transformer-un-MCD-en-MLD | |
358 | // https://www.developpez.net/forums/d1088964/general-developpement/alm/modelisation/structure-agregation-l-association-d-association/ | |
48a55161 BA |
359 | _.shuffle(i.children).forEach( c => { |
360 | if (Math.random() < 0.5) | |
3ca1e50c | 361 | mcdDot += '"' + c + '":name -- "' + i.parent + '":name [dir="forward",arrowhead="vee",'; |
48a55161 | 362 | else |
3ca1e50c BA |
363 | mcdDot += '"' + i.parent + '":name -- "' + c + '":name [dir="back",arrowtail="vee",'; |
364 | mcdDot += 'style="dashed"];\n'; | |
525c4d2a BA |
365 | }); |
366 | }); | |
367 | // Relationships: | |
c728aeca BA |
368 | if (mcdStyle == "compact") |
369 | mcdDot += 'node [shape=rectangle, style=rounded];\n'; | |
525c4d2a | 370 | let assoceCounter = 0; |
48a55161 | 371 | _.shuffle(this.associations).forEach( a => { |
19addd10 | 372 | let name = a.name || "_assoce" + assoceCounter++; |
c728aeca BA |
373 | if (mcdStyle == "bubble") |
374 | { | |
375 | mcdDot += '"' + name + '" [shape="diamond", style="filled", color="lightgrey", label="' + name + '"'; | |
376 | if (a.weak) | |
377 | mcdDot += ', peripheries=2'; | |
378 | mcdDot += '];\n'; | |
379 | if (!!a.attributes) | |
380 | { | |
381 | a.attributes.forEach( attr => { | |
382 | let label = (attr.isKey ? '#' : '') + attr.name; | |
383 | mcdDot += '"' + name + '_' + attr.name + '" [shape=ellipse, label="' + label + '"];\n'; | |
384 | let attrName = name + '_' + attr.name; | |
385 | if (Math.random() < 0.5) | |
386 | mcdDot += '"' + attrName + '" -- "' + name + '";\n'; | |
387 | else | |
388 | mcdDot += '"' + name + '" -- "' + attrName + '";\n'; | |
389 | }); | |
390 | } | |
391 | } | |
392 | else | |
393 | { | |
4ef6cded | 394 | let label = '<' + name + '>'; |
c728aeca BA |
395 | if (!!a.attributes) |
396 | { | |
397 | a.attributes.forEach( attr => { | |
398 | let attrLabel = (attr.isKey ? '#' : '') + attr.name; | |
4ef6cded | 399 | label += '\\n' + attrLabel; |
c728aeca BA |
400 | }); |
401 | } | |
402 | mcdDot += '"' + name + '" [color="lightgrey", label="' + label + '"'; | |
403 | if (a.weak) | |
404 | mcdDot += ', peripheries=2'; | |
405 | mcdDot += '];\n'; | |
406 | } | |
48a55161 BA |
407 | _.shuffle(a.entities).forEach( e => { |
408 | if (Math.random() < 0.5) | |
006d95a3 | 409 | mcdDot += '"' + e.name + '":name -- "' + name + '"'; |
48a55161 | 410 | else |
006d95a3 | 411 | mcdDot += '"' + name + '" -- "' + e.name + '":name'; |
7a80e6db | 412 | mcdDot += '[label="' + ErDiags.CARDINAL(e.card) + '"];\n'; |
525c4d2a | 413 | }); |
525c4d2a BA |
414 | }); |
415 | mcdDot += '}'; | |
3ca1e50c | 416 | //console.log(mcdDot); |
525c4d2a BA |
417 | ErDiags.AjaxGet(mcdDot, graphSvg => { |
418 | this.mcdGraph = graphSvg; | |
419 | element.innerHTML = graphSvg; | |
d6c9499e | 420 | }); |
525c4d2a BA |
421 | } |
422 | ||
19addd10 | 423 | // "Modèle logique des données", from MCD without anomalies |
48a55161 | 424 | // TODO: this one should draw links from foreign keys to keys (port=... in <TD>) |
525c4d2a BA |
425 | drawMld(id) |
426 | { | |
427 | let element = document.getElementById(id); | |
428 | if (this.mldGraph.length > 0) | |
429 | { | |
430 | element.innerHTML = this.mcdGraph; | |
431 | return; | |
432 | } | |
4ef6cded | 433 | // Build dot graph input (assuming foreign keys not already present...) |
e2610c05 | 434 | let mldDot = 'graph {\n'; |
3ca1e50c | 435 | mldDot += 'rankdir="LR";\n'; |
19addd10 BA |
436 | mldDot += 'node [shape=plaintext];\n'; |
437 | let links = ""; | |
438 | _.shuffle(Object.keys(this.tables)).forEach( name => { | |
439 | mldDot += '"' + name + '" [label=<<table BORDER="1" ALIGN="LEFT" CELLPADDING="5" CELLSPACING="0">\n'; | |
440 | mldDot += '<tr><td BGCOLOR="#ae7d4e" BORDER="0"><font COLOR="#FFFFFF">' + name + '</font></td></tr>\n'; | |
351d7a84 | 441 | this.tables[name].forEach( f => { |
19addd10 | 442 | let label = (f.isKey ? '<u>' : '') + (!!f.qualifiers && f.qualifiers.indexOf("foreign")>=0 ? '#' : '') + f.name + (f.isKey ? '</u>' : ''); |
3ca1e50c | 443 | mldDot += '<tr><td port="' + f.name + '"' + ' BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >' + label + '</font></td></tr>\n'; |
19addd10 | 444 | if (!!f.ref) |
4ef6cded | 445 | { |
3ca1e50c BA |
446 | // Need to find a key attribute in reference entity (the first...) |
447 | let keyInRef = ""; | |
448 | for (let field of this.tables[f.ref]) | |
449 | { | |
450 | if (field.isKey) | |
451 | { | |
452 | keyInRef = field.name; | |
453 | break; | |
454 | } | |
455 | } | |
19addd10 | 456 | if (Math.random() < 0.5) |
3ca1e50c | 457 | links += '"' + f.ref + '":"' + keyInRef + '" -- "' + name+'":"'+f.name + '" [dir="forward",arrowhead="dot"'; |
19addd10 | 458 | else |
3ca1e50c BA |
459 | links += '"'+name+'":"'+f.name+'" -- "' + f.ref + '":"' + keyInRef + '" [dir="back",arrowtail="dot"'; |
460 | links += ']\n;'; | |
19addd10 | 461 | } |
e2610c05 | 462 | }); |
19addd10 | 463 | mldDot += '</table>>];\n'; |
e2610c05 | 464 | }); |
19addd10 BA |
465 | mldDot += links + '\n'; |
466 | mldDot += '}\n'; | |
3ca1e50c | 467 | //console.log(mldDot); |
d6c9499e BA |
468 | ErDiags.AjaxGet(mldDot, graphSvg => { |
469 | this.mldGraph = graphSvg; | |
470 | element.innerHTML = graphSvg; | |
471 | }); | |
525c4d2a BA |
472 | } |
473 | ||
474 | fillSql(id) | |
475 | { | |
476 | let element = document.getElementById(id); | |
477 | if (this.sqlText.length > 0) | |
478 | { | |
479 | element.innerHTML = this.sqlText; | |
480 | return; | |
481 | } | |
19addd10 BA |
482 | let sqlText = ""; |
483 | Object.keys(this.tables).forEach( name => { | |
484 | sqlText += "CREATE TABLE " + name + " (\n"; | |
485 | let key = ""; | |
486 | this.tables[name].forEach( f => { | |
3ca1e50c | 487 | sqlText += "\t" + f.name + " " + (f.type || "TEXT") + " " + (f.qualifiers || "") + ",\n"; |
19addd10 BA |
488 | if (f.isKey) |
489 | key += (key.length>0 ? "," : "") + f.name; | |
490 | }); | |
3ca1e50c | 491 | sqlText += "\tPRIMARY KEY (" + key + ")\n"; |
19addd10 BA |
492 | sqlText += ");\n"; |
493 | }); | |
494 | //console.log(sqlText); | |
495 | this.sqlText = sqlText; | |
496 | element.innerHTML = "<pre><code>" + sqlText + "</code></pre>"; | |
525c4d2a BA |
497 | } |
498 | } |