@ronin/compiler
Advanced tools
Comparing version 0.14.9 to 0.14.10
@@ -397,4 +397,2 @@ /** | ||
inlineParams?: boolean; | ||
/** Alias column names that are duplicated when joining multiple tables. */ | ||
expandColumns?: boolean; | ||
} | ||
@@ -401,0 +399,0 @@ declare class Transaction { |
{ | ||
"name": "@ronin/compiler", | ||
"version": "0.14.9", | ||
"version": "0.14.10", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Compiles RONIN queries to SQL statements.", |
@@ -73,3 +73,3 @@ # RONIN Compiler | ||
// Passing `rawResults` (rows being arrays of values) provided by the database (ideal) | ||
const results: Array<Result> = transaction.formatResults(rawResults); | ||
const results: Array<Result> = transaction.formatResults(rawResults, true); | ||
@@ -131,22 +131,3 @@ // Passing `objectResults` (rows being objects) provided by a driver | ||
// This option should only be used if the generated SQL will be manually verified. | ||
inlineParams: true, | ||
// By default, in the generated SQL statements, the compiler does not alias columns if | ||
// multiple different tables with the same column names are being joined. Only the table | ||
// names themselves are aliased. | ||
// | ||
// This ensures the cleanest possible SQL statements in conjunction with the default | ||
// behavior of SQL databases, where the result of a statement is a list (array) of | ||
// values, which are inherently not prone to conflicts. | ||
// | ||
// If the driver being used instead returns an object for every row, the driver must | ||
// ensure the uniqueness of every key in that object, which means prefixing duplicated | ||
// column names with the name of the respective table, if multiple tables are joined | ||
// (example for an object key: "table_name.column_name"). | ||
// | ||
// Drivers that return objects for rows offer this behavior as an option that is | ||
// usually called "expand columns". If the driver being used does not offer such an | ||
// option, you can instead activate the option in the compiler, which results in longer | ||
// SQL statements because all column names are aliased. | ||
expandColumns: true | ||
inlineParams: true | ||
}); | ||
@@ -153,0 +134,0 @@ ``` |
Sorry, the diff of this file is too big to display
110329
2547
167