-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mssql docs #724
Mssql docs #724
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey 👋
Thanks! 💪
Let some initial comments..
We need to somehow mention that it also uses Tarn for connection pool management and provide a link to tarn's documentation. |
Regarding Deno compatibility, here's an official issue that seems related to the problem (and someone claimed it still doesn't work 2 weeks ago despite being closed). |
Regarding Bun compatibility, here's an issue that seems related to the problem (all commenters use libraries that use tedious under the hood). |
…MSSQL pretty dialect name more clear Co-authored-by: Igal Klebanov <[email protected]>
Hey @igalklebanov Thanks for all your work maintaining this library by the way. You all do an amazing job. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Just a small correction..
…Kysely Co-authored-by: Igal Klebanov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @igalklebanov, Sorry about that. I ran into some issues getting that one to work and forgot about it (and didn't run typecheck 🤦♂️) I meant to ask: what would be a preferable solution for inserting a new row and returning data from that inserted row while #687 is still open? export async function createPerson(person: NewPerson) {
await db.insertInto('person')
.values(person)
.executeTakeFirstOrThrow()
const newPerson = (await findPeople(person)).at(-1)
return newPerson
}
export async function deletePerson(id: number) {
const person = await findPersonById(id)
if (person) {
await db.deleteFrom('person').where('id', '=', id).execute()
}
return person
} I think that the data will be sorted by id, so this would grab the most recently inserted row, but there would be issues if something was inserted to the table with identical values between the execution of the insertInto line and newPerson line. Am I missing something or would there be no better option until the output clause is supported? |
@gittgott I'd prefer using scope identity in a transaction. |
Co-authored-by: Igal Klebanov <[email protected]>
closes #713
I couldn't get deno or bun to work with the dialect. Deno was having issues connecting to the database with the message
Error: Failed to connect to localhost:1433 - tlssock._start is not a function
. Bun was having issues with tarn with the messageFailed to connect to localhost:1433 - socket must be an instance of net.Socket
.Since this wasn't working for me, I stated that bun and deno didn't support the mssql dialect in the docs. Just want to make sure that they aren't currently known to work.
Thanks!