
@sorawee what if you used set!
?

In the above example: yes, I can use set!
instead, but in general, they are not equivalent.

E.g.,
(define (test)
(define x 1)
(define y (thunk x))
(set! x 2)
(y))
(test) ;=> 2
(define (test-2)
(let* ([x 1]
[y (thunk x)]
[x 2])
(y)))
(test-2) ;=> 1

@ldcc has joined the channel

Maybe package-begin
with define*
in compatibility/package
.

Wow! racket has 3000 stars on github!

I am playing around with MySQL 8.0 and have created a database using the terminal.

Now I am trying to connect to the database from racket.

I get the error:

../../../../../Applications/Racket v7.0/collects/db/private/generic/interfaces.rkt:209:0: mysql-connect: back end requested unsupported authentication plugin
plugin: "caching_sha2_password"

The MySQL documentation says:

In MySQL 8.0, caching_sha2_password is the default authentication plugin rather than mysql_native_password.

Line 209 of interfaces.rkt is: https://github.com/racket/db/blob/master/db-lib/db/private/mysql/connection.rkt#L188

So only “mysql_native_password” is supported.

@soegaard2 That seems to be intentional according to the docs: https://docs.racket-lang.org/db/notes.html?q=db#%28part._.My.S.Q.L_.Authentication%29

Well, not “intentional” as in intentionally not supporting the new thing.

Just that it knows there are “auth plugins” and intentionally only supports two, for now.

Thanks for looking at this.

Sounds like a new feature request for db/mysql

I found this in the mysql docs:


I’ve only ever used postgres and sqlite. I don’t know much about mysql, or when I might want to use that.

Maybe I should try postgres instead.

The option file mentioned in the MySQL is simple enough:

[mysqld]
default_authentication_plugin=mysql_native_password

they don’t mention where it is located …

Will the db server and your Racket app using it, both be on the same machine?

or the file name for that matter.

Potentially they can be on different machines - therefore I opted for something else than SQLite.

Oh OK. I asked only because postgres and mysql both support connections via a Unix domain socket, instead of TCP. And that’s safer when client and server are both on same machine.

(And it looks like Ryan spent some time both adding support for domain sockets to Racket, and, using them in db. I think w/in the last year or so. So that’s cool. But I guess orthogonal to your current problem.)

That’s a great tip. Honestly I don’t know whether I ever will need two different machines - so sockets might be the solution in the beginning.

That way your dev machine isn’t open for db access to the world — or to Javascript running in your browser ¯_(ツ)_/¯

Which can access TCP ports, you should assume.

Good point.

Do you have advice on materials on best practices regarding databases? It’s been a while since I needed one last.

That’s an excellent question. I can’t think of good materials, right now. Hopefully someone else can suggest something. I’ll let you know if something occurs to me later.

Thanks.

I think the postgres docs are pretty good, overall? But I don’t recall the user’s guide or best practices kind of material.

Alas I must go, it is time for me to start making my Sunday bolognese sauce…

Yeah, need to make dinner too.