Skip to content
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

[v2.0.0] Deprecated exports removed (export "..." does not exist) #84

Closed
thelindat opened this issue Feb 14, 2022 · 0 comments
Closed
Labels
documentation Improvements or additions to documentation wontfix This will not be worked on

Comments

@thelindat
Copy link
Member

As planned with the release of v1.9.0, all deprecated exports have been removed. There has been more than two months notice about these changes, so if you have resources that aren't modified then you can either make the changes yourself, or wait before updating.

Resources should be using @oxmysql/lib/MySQL.lua

  • Provides some extra debugging options, with more changes to come in a future update
  • Allows for simple migration from mysql-async
    • All old syntax is available (i.e. MySQL.Async.fetchAll)
    • So long as no folder exists for mysql-async, you can continue using @mysql-async/lib/MySQL.lua
  • New syntax replaces raw calls to exports (i.e. MySQL.query.await)

Refer to our documentation for usage.

JavaScript users

  • You can continue using exports, however most of them have been renamed.
  • All exports with the Sync suffix are now called with _async.
  • For less confusion between mysql-async and ghmattimysql, both fetch and execute are replaced with query.

Quick samples

local result = MySQL.query.await('SELECT * FROM users')
print(result[1].firstname)

local result = MySQL.Sync.fetchAll('SELECT * FROM users')
print(result[1].firstname)

MySQL.query('SELECT * FROM users', function(result)
    print(result[1].firstname)
end)

MySQL.Async.fetchAll('SELECT * FROM users', function(result)
    print(result[1].firstname)
end)
const result = await exports.oxmysql.query_async('SELECT * FROM users')
console.log(result[0].firstname)

exports.oxmysql.query_async('SELECT * FROM users').then((result) => {
  console.log(result[0].firstname)
})

exports.oxmysql.query('SELECT * FROM users', (result) => {
  console.log(result[0].firstname)
})
@thelindat thelindat added documentation Improvements or additions to documentation wontfix This will not be worked on labels Feb 14, 2022
@thelindat thelindat pinned this issue Mar 8, 2022
@thelindat thelindat unpinned this issue Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant