-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function: chdb() to return version #25
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is an example of a C++ function that returns the current version of chDB as a string. The version number is defined using the CHDB_VERSION_STRING macro, which should be defined during the build process. The FunctionChdbVersion class is a subclass of FunctionConstantBase, which is a base class for functions that return a constant value. The FunctionChdbVersion constructor takes the CHDB_VERSION_STRING macro as an argument, which is passed to the FunctionConstantBase constructor to set the constant value of the function. The REGISTER_FUNCTION macro is used to register the FunctionChdbVersion function with the FunctionFactory. The REGISTER_FUNCTION macro should be conditionally compiled using an #if directive that checks whether the CHDB_VERSION_STRING macro is defined, to avoid registering the function if the version number is not available.
Tested w/ ClickHouse Build Flag:
Validation:
|
lmangani
changed the title
WIP: add function: chdb() to return version
add function: chdb() to return version
Apr 27, 2023
auxten
changed the title
add function: chdb() to return version
Add function: chdb() to return version
Apr 27, 2023
auxten
pushed a commit
that referenced
this pull request
Jun 27, 2023
* add function: chdb() to return version This is an example of a C++ function that returns the current version of chDB as a string. The version number is defined using the CHDB_VERSION_STRING macro, which should be defined during the build process. The FunctionChdbVersion class is a subclass of FunctionConstantBase, which is a base class for functions that return a constant value. The FunctionChdbVersion constructor takes the CHDB_VERSION_STRING macro as an argument, which is passed to the FunctionConstantBase constructor to set the constant value of the function. The REGISTER_FUNCTION macro is used to register the FunctionChdbVersion function with the FunctionFactory. The REGISTER_FUNCTION macro should be conditionally compiled using an #if directive that checks whether the CHDB_VERSION_STRING macro is defined, to avoid registering the function if the version number is not available. * Update chdbVersion.cpp * Update chdbVersion.cpp * Update CMakeLists.txt * Update CMakeLists.txt
auxten
pushed a commit
that referenced
this pull request
Jun 28, 2023
* add function: chdb() to return version This is an example of a C++ function that returns the current version of chDB as a string. The version number is defined using the CHDB_VERSION_STRING macro, which should be defined during the build process. The FunctionChdbVersion class is a subclass of FunctionConstantBase, which is a base class for functions that return a constant value. The FunctionChdbVersion constructor takes the CHDB_VERSION_STRING macro as an argument, which is passed to the FunctionConstantBase constructor to set the constant value of the function. The REGISTER_FUNCTION macro is used to register the FunctionChdbVersion function with the FunctionFactory. The REGISTER_FUNCTION macro should be conditionally compiled using an #if directive that checks whether the CHDB_VERSION_STRING macro is defined, to avoid registering the function if the version number is not available. * Update chdbVersion.cpp * Update chdbVersion.cpp * Update CMakeLists.txt * Update CMakeLists.txt
auxten
pushed a commit
that referenced
this pull request
Aug 15, 2023
* add function: chdb() to return version This is an example of a C++ function that returns the current version of chDB as a string. The version number is defined using the CHDB_VERSION_STRING macro, which should be defined during the build process. The FunctionChdbVersion class is a subclass of FunctionConstantBase, which is a base class for functions that return a constant value. The FunctionChdbVersion constructor takes the CHDB_VERSION_STRING macro as an argument, which is passed to the FunctionConstantBase constructor to set the constant value of the function. The REGISTER_FUNCTION macro is used to register the FunctionChdbVersion function with the FunctionFactory. The REGISTER_FUNCTION macro should be conditionally compiled using an #if directive that checks whether the CHDB_VERSION_STRING macro is defined, to avoid registering the function if the version number is not available. * Update chdbVersion.cpp * Update chdbVersion.cpp * Update CMakeLists.txt * Update CMakeLists.txt
auxten
pushed a commit
that referenced
this pull request
Nov 9, 2023
* add function: chdb() to return version This is an example of a C++ function that returns the current version of chDB as a string. The version number is defined using the CHDB_VERSION_STRING macro, which should be defined during the build process. The FunctionChdbVersion class is a subclass of FunctionConstantBase, which is a base class for functions that return a constant value. The FunctionChdbVersion constructor takes the CHDB_VERSION_STRING macro as an argument, which is passed to the FunctionConstantBase constructor to set the constant value of the function. The REGISTER_FUNCTION macro is used to register the FunctionChdbVersion function with the FunctionFactory. The REGISTER_FUNCTION macro should be conditionally compiled using an #if directive that checks whether the CHDB_VERSION_STRING macro is defined, to avoid registering the function if the version number is not available. * Update chdbVersion.cpp * Update chdbVersion.cpp * Update CMakeLists.txt * Update CMakeLists.txt
auxten
pushed a commit
that referenced
this pull request
Jun 7, 2024
* add function: chdb() to return version This is an example of a C++ function that returns the current version of chDB as a string. The version number is defined using the CHDB_VERSION_STRING macro, which should be defined during the build process. The FunctionChdbVersion class is a subclass of FunctionConstantBase, which is a base class for functions that return a constant value. The FunctionChdbVersion constructor takes the CHDB_VERSION_STRING macro as an argument, which is passed to the FunctionConstantBase constructor to set the constant value of the function. The REGISTER_FUNCTION macro is used to register the FunctionChdbVersion function with the FunctionFactory. The REGISTER_FUNCTION macro should be conditionally compiled using an #if directive that checks whether the CHDB_VERSION_STRING macro is defined, to avoid registering the function if the version number is not available. * Update chdbVersion.cpp * Update chdbVersion.cpp * Update CMakeLists.txt * Update CMakeLists.txt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a simple
chdb()
function with no parameters that returns the current version of chDB as a string.The version number is defined using the
CHDB_VERSION
macro, which should be defined during the build process.The function is conditionally compiled using an
#if
directive that checks whether theCHDB_VERSION_STRING
macro derived fromCHDB_VERSION
is defined, to avoid building and registering the function if the version number is not available.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
add function
chdb()
returning the current build version