Skip to content

Instantly share code, notes, and snippets.

@elpete
Last active November 5, 2015 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elpete/521cdd4ee0b9bc506ed3 to your computer and use it in GitHub Desktop.
Save elpete/521cdd4ee0b9bc506ed3 to your computer and use it in GitHub Desktop.
ACF vs Lucee ColumnList Implementation
<cfscript>
data = QueryNew('name,id,salary', 'cf_sql_varchar,cf_sql_integer,cf_sql_integer', [
{ name = 'Jack Harkness', id = 1, salary = 5800000 },
{ name = 'Donna Noble', id = 2, salary = 4800000 },
{ name = 'Clara Oswald', id = 3, salary = 6200000 },
{ name = 'Rory Williams', id = 4, salary = 2650000 },
{ name = 'Sarah Jane Smith', id = 5, salary = 2200000 }
]);
writeDump(data.columnList);
writeDump(getMetadata(data));
</cfscript>
<cfscript>
data = QueryNew('name,id,salary', 'cf_sql_varchar,cf_sql_integer,cf_sql_integer', [
{ name = 'Jack Harkness', id = 1, salary = 5800000 },
{ name = 'Donna Noble', id = 2, salary = 4800000 },
{ name = 'Clara Oswald', id = 3, salary = 6200000 },
{ name = 'Rory Williams', id = 4, salary = 2650000 },
{ name = 'Sarah Jane Smith', id = 5, salary = 2200000 }
]);
columnArray = [];
for(column in getMetadata(data)) {
ArrayAppend(columnArray, column.name);
}
writeDump(ArrayToList(columnArray));
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment