How do I load an extension
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 3.3k
- Fork
- 676
- Merge medio
- 1g 15h
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di xerial/sqlite-jdbc
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
xerial/sqlite-jdbc#1515 ·
I maintainer di solito rispondono entro 1 giorno
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
xerial/sqlite-jdbc#1514 ·
I maintainer di solito rispondono entro 1 giorno
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
xerial/sqlite-jdbc#1513 ·
I maintainer di solito rispondono entro 1 giorno
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
xerial/sqlite-jdbc#1512 ·
I maintainer di solito rispondono entro 1 giorno
-
SIGSEGV (exit 134) in bundled `rightstr()` when the length argument is a large negative numberForse già presa @sarthakdev143-lite l’ha presa 1 giorno fa. Apertahelp wanted impacts:JNI
Difficoltà 4/5 1-2 giorni Idoneità per principianti 38/100
xerial/sqlite-jdbc#1508 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di xerial/sqlite-jdbc
Issue simili
-
Area/Configuration Type/Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ballerina-platform/static-code-analysis-tool#217 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
eclipse-dirigible/dirigible#8636 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug severity-medium XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
nikolas-charalambidis/facepalm-maven-plugin#291 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
OakLoaf/PluginUpdater#264 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: withStartupTimeout() changes the startup timeout of all containers that use the default wait strategyForse già presa @aymenjamaaoui l’ha presa oggi. Apertatype/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
testcontainers/testcontainers-java#12171 ·
I maintainer di solito rispondono entro 1 giorno