Navigation Menu

Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Update SqliteCommand.Prepare implementation #388

Merged
merged 2 commits into from Jul 21, 2017
Merged

Update SqliteCommand.Prepare implementation #388

merged 2 commits into from Jul 21, 2017

Conversation

bricelam
Copy link
Contributor

@bricelam bricelam commented Jul 20, 2017

8e4db99 improves on the previous implementation we tried.

I ran a quick benchmark reusing a parameterized INSERT command for fun: 4x faster!

  Mean Error StdDev
Before 4.184 us 0.0835 us 0.2001 us
After 1.048 us 0.0208 us 0.0415 us

Resolves #235

/cc @AlexanderTaeschner

}
catch
{
if (unprepared)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update to catch..when.

throw new InvalidOperationException(Resources.SetRequiresNoOpenReader(nameof(CommandText)));
}

if (!value.Equals(_commandText))
Copy link
Contributor Author

@bricelam bricelam Jul 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible null ref. Will update.

@@ -198,4 +198,10 @@
<data name="CannotStoreNaN" xml:space="preserve">
<value>Cannot store 'NaN' values.</value>
</data>
<data name="DataReaderOpen" xml:space="preserve">
<value>An open DataReader is already associated with this command. Close it before opening a new one.</value>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be data reader.

var rc = raw.sqlite3_prepare_v2(
_connection.Handle,
tail,
out sqlite3_stmt stmt,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants