Skip to content

Instantly share code, notes, and snippets.

@davejlong
Created May 26, 2011 17:52
Show Gist options
  • Save davejlong/993621 to your computer and use it in GitHub Desktop.
Save davejlong/993621 to your computer and use it in GitHub Desktop.
In-memory databases with Railo
<cftry>
<cfquery name="create" datasource="inmemory">
CREATE TABLE testTable (
testID INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
test VARCHAR(50)
)
</cfquery>
<cfcatch type="any">
<!--- Well this sucks. Now our application can't do anything. --->
</cfcatch>
</cftry>
<cfquery name="insert" datasource="inmemory">
INSERT INTO testTable (test)
VALUES(<cfqueryparam value="foo" cfsqltype="cf_sql_varchar" />)
</cfquery>
<cfquery name="select" datasource="inmemory">
SELECT * FROM testTable
</cfquery>
<cfdump var="#select#">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment