SqlChat - NL to SQL: differenze tra le versioni

Da Webmobili Wiki.
Riga 43: Riga 43:
<code>/etc/apache2/sites-available/sqlchat.dbdemo47.com.conf</code>
<code>/etc/apache2/sites-available/sqlchat.dbdemo47.com.conf</code>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
#
#
# sqlchat.dbdemo47.com
# sqlchat.dbdemo47.com
Riga 68: Riga 67:
</VirtualHost>
</VirtualHost>


</syntaxhighlight>
Abilitare il modulo <code>proxy_http</code>
<syntaxhighlight lang="bash">
sudo a2enmod proxy
sudo a2enmod proxy_http
</syntaxhighlight>
</syntaxhighlight>

Versione delle 18:05, 14 gen 2025

https://github.com/sqlchat/sqlchat

Si propone di fare query con linguaggio naturale, leggendo la struttura del database.

Non fa altro che cercare di interpretare e generare un SQL corrispondente.


Installazione in produzione

Node.js

Configurare l'ambiente per Node.js

# Scarica l'ultima versione di nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc

# Installa Node.js 22
nvm install 22
nvm use 22

# Verificare con
node --version

# Verifica i rilasci ufficiali
nvm ls-remote

# eventualmente installare la versione voluta con
nvm install [version_number]

Aggiornare npm , Node Package Manager

npm install npm@latest -g

Installare pnpm, Performant Node Package Manager

npm install pnpm

Apache config

Creare un virtualhost che faccia da reverse proxy per node.
/etc/apache2/sites-available/sqlchat.dbdemo47.com.conf

#
# sqlchat.dbdemo47.com
#
<VirtualHost *:80>
        ServerName sqlchat.dbdemo47.com
        Redirect / https://%{SERVER_NAME}%{REQUEST_URI}
</VirtualHost>

<VirtualHost *:443>
        # Basic Auth
        <Location />
                AuthName "Dialog prompt"
                AuthType Basic
                AuthUserFile /var/www/auth/.htpasswd
                Require valid-user
        </Location>

        ServerAdmin info@designbest.com
        ServerName sqlchat.dbdemo47.com

        ProxyPass / http://localhost:3000/
        ProxyPassReverse / http://localhost:3000/
</VirtualHost>

Abilitare il modulo proxy_http

sudo a2enmod proxy
sudo a2enmod proxy_http