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

Support SQLite 3.7.9 #171

Merged
merged 1 commit into from
Nov 5, 2015
Merged

Support SQLite 3.7.9 #171

merged 1 commit into from
Nov 5, 2015

Conversation

natemcmaster
Copy link
Contributor

SQLite 3.7.9 is the default library version on Travis Linux agents.
3.7.13 is the default version on aspnet-docker (Fix aspnet/aspnet-docker#85) and Travis OSX agents.

Fallback to older sqlite3 calls when using older versions of sqlite3.

sqlite3_close and sqlite3_errstr do not exist < 3.7.15
sqlite3_db_filename does not exist < 3.7.10

Add internal utilities for working with different sqlite versions and testing.
Add OSX and Mono alpha to test matrix.

@natemcmaster
Copy link
Contributor Author

cc @bricelam

rc,
NativeMethods.sqlite3_errmsg(db));
}
else if (SqliteVersion.Current >= "3.7.15")
Copy link
Contributor

Choose a reason for hiding this comment

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

Careful, the string "3.10" is less than "3.7". You may want to use the Version class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SqliteVersion (had) an implicit string conversion operator...too magic?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yes, too... C++

@bricelam
Copy link
Contributor

bricelam commented Nov 5, 2015

We should try to put all the switching based on version into its own component. I don't like it scattered throughout the code.

{
public readonly static Version Current = new Version(NativeMethods.sqlite3_libversion());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

'Tis a silly class. I like the idea of putting a public static SQLITE_VERSION field on NativeMethods that gets initialized in the static constructor. SqliteConnection.ServerVersion should be updated to use it. Then again, does the value even need to be cached?

return Strings.FormatSqliteNativeErrorStringMissing(rc);
}

internal static bool SqliteClose(IntPtr handle)
Copy link
Contributor

Choose a reason for hiding this comment

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

If the class is internal, these might as well be public.

@bricelam
Copy link
Contributor

bricelam commented Nov 5, 2015

:shipit:

Fallback to older sqlite3 calls when using older versions of sqlite3.
Fallback to sqlite3_close when sqlite3_close_v2 is not available, e.g. older versions of OSX.
Workaround for missing sqlite3_errstr in versions < 3.7.15

Add OSX to test matrix.
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.

3 participants