langchainjs
langchainjs copied to clipboard
[WIP] add Sqldatabase.ts file to be able to create SQLDatabaseChain after that
To test it with Typeorm, you can create a dataSource like this:
import { DataSource } from "typeorm";
const postgresDataSource = new DataSource({
type: "postgres",
host: "localhost",
port: 5432,
username: "nestjs",
password: "...",
database: "...",
});
this looks great! I added basic, sqlite only support in #132. We can consolidate there? Happy to help
Hey @agola11 , just finished the sqldatabasechain + start the generic of sqldatabase.ts Is it ok for you if we merge this and then we refacto to take into account what you did for sqlite?
Great work! How many sql databases will this support? (I guess this is limited by typeorm?)
Hey @tonyabracadabra . Yes final state should be all database supported by TypeOrm. For the moment pg and sqlite. But it's not a lot of work to add one as you can see in my last commit
Hi @MaximeThoonsen -- thanks for the work on this so far! There are a couple of things @nfcampos and I want to do in order to merge this PR in by tomorrow: namely, add some tests, examples, docs, and convenience functions. In order to do that, I'll merge this PR in into a branch ankush/sql-database in the main hwchase17/langchainjs repo. You'll still be associated with the commit once it gets merged in to hwchase17/langchainjs:main.
Hey @agola11 ok thanks for the help.
@MaximeThoonsen Hi trying to test with typeorm + pg, any idea why this issue occur?
This is my datasource:
const datasource = new DataSource({ type: type, host: host, port: parseInt(port), username: username, password: password, database: database, synchronize: true, logging: true, })
Thanks in advance
@buenaSopa do you have installed the pg package ?
@MaximeThoonsen yep, I've installed everything needed. I've decided to create a new project and it works there, so things kinda sorted out for now. Thanks tho