Sha256: 510430b487113013da0a89d7681446ae12d06af6f202ef44c6360b00849cce35

Contents?: true

Size: 1.7 KB

Versions: 4

Compression:

Stored size: 1.7 KB

Contents

#--
# Copyright (c) 2023 Jeremy Hinegardner
# All rights reserved.  See LICENSE and/or COPYING for details.
#++
module ::Libsql 
  module SQLite3
    module Version
      # Sqlite3 version number is equal to 
      # MAJOR * 1_000_000 + MINOR * 1_000 + RELEASE

      # major version number of the SQLite C library
      MAJOR   = (to_i / 1_000_000).freeze

      # minor version number of the SQLite C library
      MINOR   = ((to_i % 1_000_000) / 1_000).freeze

      # release version number of the SQLite C library
      RELEASE = (to_i % 1_000).freeze

      #
      # call-seq:
      #   ::Libsql::SQLite3::Version.to_a -> [ MAJOR, MINOR, RELEASE ]
      #
      # Return the SQLite C library version number as an array of MAJOR, MINOR,
      # RELEASE
      # 
      def self.to_a
        [ MAJOR, MINOR, RELEASE ]
      end

      def self.compiled_matches_runtime?
        self.compiled_version == self.runtime_version
      end
    end

    # Version of SQLite that ships with ::Libsql
    VERSION = Version.to_s.freeze
  end
end

unless ::Libsql::SQLite3::Version.compiled_matches_runtime? then
  warn <<eom
You are seeing something odd.  The compiled version of SQLite that
is embedded in this extension is for some reason, not being used.
The version in the extension is #{::Libsql::SQLite3::Version.compiled_version} and the version that
as been loaded as a shared library is #{::Libsql::SQLite3::Version.runtime_version}.  These versions
should be the same, but they are not.

One known issue is if you are using this libary in conjunction with
Hitimes on Mac OS X.  You should make sure that "require 'libsql'"
appears before "require 'hitimes'" in your ruby code.

This is a non-trivial problem, and I am working on it.
eom
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
libsql-0.1.0-x64-mingw-ucrt lib/libsql/sqlite3/version.rb
libsql-0.1.0-x64-mingw32 lib/libsql/sqlite3/version.rb
libsql-0.1.0-x86-mingw32 lib/libsql/sqlite3/version.rb
libsql-0.1.0 lib/libsql/sqlite3/version.rb