How do I load an extension
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reading the extension loading notes and the native build configuration for sqlite-jdbc; the report says the extension code was copied into src/main/ext and built with make native before mvn package. Check how the bundled extension-functions extension is compiled and exposed to JDBC connections. Done means documenting or fixing the steps so the built in memstat extension is available to query, with the reported no table behavior resolved.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
I added memstat extension by copying code from https://sqlite.org/src/file/ext/misc/memstat.c and pasting it in src/main/ext.
Then i did:
- update makefile with -DSQLITE_DEFAULT_MEMSTATUS=1 -DSQLITE_ENABLE_MEMSTATVTAB=1
- make native (mine is linux x86_64)
- mvn package
This produced the jar.
Now I copied the Sample.java, showing relevant section below:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.sqlite.core.DB;
import org.sqlite.SQLiteConnection;
import java.util.Properties;
public class Sample
{
public static void main(String[] args)
{
Connection connection = null;
Properties properties = new Properties();
properties.setProperty("enable_load_extension", "true");
try
{
// create a database connection
connection = DriverManager.getConnection("jdbc:sqlite:memory:", properties);
// sql queries to load extensions
// connection.prepareStatement("SELECT load_extension('memstat')").execute(); -> perhaps this is not needed?
Statement sm = connection.createStatement();
ResultSet rr = sm.executeQuery("select * from memstat"); -> throws no table , tried sqlite_memstat too
while(rr.next()) {
System.out.println(rr.getString("name"));
}
I was able to use a .so file and load that but I want to compile it together as done for extension-functions
Expected behavior
I expected to see memstat table.
Logs
If applicable, provide logs.
Environment (please complete the following information):
- OS: Linux
- CPU architecture: x86_64
- sqlite-jdbc version 3.39.2.0
Additional context
Add any other context about the problem here.
- 主要言語
- Java
- スター
- 3.3k
- フォーク
- 676
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
xerial/sqlite-jdbc のほかの issue
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
xerial/sqlite-jdbc#1515 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
xerial/sqlite-jdbc#1514 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
xerial/sqlite-jdbc#1513 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
xerial/sqlite-jdbc#1512 ·
メンテナーはふだん 1 日以内に返信
-
SIGSEGV (exit 134) in bundled `rightstr()` when the length argument is a large negative number対応中かも @sarthakdev143-lite が 2 日前に担当しました。 オープンhelp wanted impacts:JNI
難易度 4/5 1〜2日 初心者へのやさしさ 38/100
xerial/sqlite-jdbc#1508 ·
メンテナーはふだん 1 日以内に返信
xerial/sqlite-jdbc の issue をすべて見る
似ている issue
-
hermes-queue
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
chrisalunlloyd2-sudo/mindpalace#403 ·
メンテナーはふだん 1 日以内に返信
-
Area/Configuration Type/Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ballerina-platform/static-code-analysis-tool#217 ·
メンテナーはふだん 1 日以内に返信
-
SequenceEncoder: a value ending with a backslash swallows the tokens after it (“No state for trait”)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
vassalengine/vassal#15337 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
eclipse-dirigible/dirigible#8636 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug severity-medium XS
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
nikolas-charalambidis/facepalm-maven-plugin#291 ·
メンテナーはふだん 1 日以内に返信