[GH-ISSUE #3100] [FEAT]: SQL Connection preflight connection #1985

Closed
opened 2026-02-22 18:27:33 -05:00 by yindo · 8 comments
Owner

Originally created by @davini-dev on GitHub (Feb 3, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3100

Originally assigned to: @shatfield4 on GitHub.

What would you like to see?

There could be a button to test before saving the database connection.

Thanks

Originally created by @davini-dev on GitHub (Feb 3, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3100 Originally assigned to: @shatfield4 on GitHub. ### What would you like to see? There could be a button to test before saving the database connection. Thanks
yindo added the enhancementfeature request labels 2026-02-22 18:27:33 -05:00
yindo closed this issue 2026-02-22 18:27:33 -05:00
Author
Owner

@mainifestion1 commented on GitHub (Feb 9, 2025):

Here's a simple example of a SQL connection prelight feature implemented in Python:

import sqlite3
import threading

class SQLConnectionPrelight:
    def __init__(self, db_path):
        self.db_path = db_path
        self.connection = None
        self.lock = threading.Lock()

    def prelight_connection(self):
        with self.lock:
            if self.connection is None:
                self.connection = sqlite3.connect(self.db_path)
                print("Prelight connection established")

    def get_connection(self):
        with self.lock:
            if self.connection is None:
                self.prelight_connection()
            return self.connection

    def close_connection(self):
        with self.lock:
            if self.connection is not None:
                self.connection.close()
                self.connection = None
                print("Connection closed")

# Example usage
db_path = "example.db"
prelight_connection = SQLConnectionPrelight(db_path)

# Establish prelight connection
prelight_connection.prelight_connection()

# Get connection
connection = prelight_connection.get_connection()

# Use connection
cursor = connection.cursor()
cursor.execute("SELECT * FROM example_table")
results = cursor.fetchall()
print(results)

# Close connection
prelight_connection.close_connection()
@mainifestion1 commented on GitHub (Feb 9, 2025): Here's a simple example of a SQL connection prelight feature implemented in Python: ``` import sqlite3 import threading class SQLConnectionPrelight: def __init__(self, db_path): self.db_path = db_path self.connection = None self.lock = threading.Lock() def prelight_connection(self): with self.lock: if self.connection is None: self.connection = sqlite3.connect(self.db_path) print("Prelight connection established") def get_connection(self): with self.lock: if self.connection is None: self.prelight_connection() return self.connection def close_connection(self): with self.lock: if self.connection is not None: self.connection.close() self.connection = None print("Connection closed") # Example usage db_path = "example.db" prelight_connection = SQLConnectionPrelight(db_path) # Establish prelight connection prelight_connection.prelight_connection() # Get connection connection = prelight_connection.get_connection() # Use connection cursor = connection.cursor() cursor.execute("SELECT * FROM example_table") results = cursor.fetchall() print(results) # Close connection prelight_connection.close_connection() ```
Author
Owner

@davini-dev commented on GitHub (Feb 14, 2025):

Sorry but
How do I test the database connection through the webUI interface?

@davini-dev commented on GitHub (Feb 14, 2025): Sorry but How do I test the database connection through the webUI interface?
Author
Owner

@timothycarambat commented on GitHub (Feb 14, 2025):

That is what this feature request is - it doesn't exist

@timothycarambat commented on GitHub (Feb 14, 2025): That is what this feature request is - it doesn't exist
Author
Owner

@mainifestion1 commented on GitHub (Feb 14, 2025):

"Select 1"
Or @@Version

@mainifestion1 commented on GitHub (Feb 14, 2025): "Select 1" Or @@Version
Author
Owner

@mainifestion1 commented on GitHub (Feb 15, 2025):

Ill make it. Give me a hot second. Im brand new at this and putting it together qucikly. Its going to be amazing when I do.

@mainifestion1 commented on GitHub (Feb 15, 2025): Ill make it. Give me a hot second. Im brand new at this and putting it together qucikly. Its going to be amazing when I do.
Author
Owner

@davini-dev commented on GitHub (Feb 15, 2025):

You are an inspiration to us

@davini-dev commented on GitHub (Feb 15, 2025): You are an inspiration to us
Author
Owner

@daochuhun commented on GitHub (Feb 19, 2025):

looking forward to this feature

@daochuhun commented on GitHub (Feb 19, 2025): looking forward to this feature
Author
Owner

@timothycarambat commented on GitHub (Sep 15, 2025):

Resolved by #4150

@timothycarambat commented on GitHub (Sep 15, 2025): Resolved by #4150
yindo changed title from [FEAT]: SQL Connection preflight connection to [GH-ISSUE #3100] [FEAT]: SQL Connection preflight connection 2026-06-05 14:43:51 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1985