notjack
2019-6-2 08:20:02

@sorawee what if you used set!?


sorawee
2019-6-2 08:24:53

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


sorawee
2019-6-2 08:25:06

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
2019-6-2 15:01:17

@ldcc has joined the channel


mflatt
2019-6-2 16:20:35

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


spdegabrielle
2019-6-2 16:34:47

Wow! racket has 3000 stars on github!


soegaard2
2019-6-2 17:35:34

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


soegaard2
2019-6-2 17:35:48

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


soegaard2
2019-6-2 17:35:53

I get the error:


soegaard2
2019-6-2 17:36:16
../../../../../Applications/Racket v7.0/collects/db/private/generic/interfaces.rkt:209:0: mysql-connect: back end requested unsupported authentication plugin
  plugin: "caching_sha2_password"

soegaard2
2019-6-2 17:36:39

The MySQL documentation says:


soegaard2
2019-6-2 17:36:44
In MySQL 8.0, caching_sha2_password is the default authentication plugin rather than mysql_native_password.

soegaard2
2019-6-2 17:38:32

soegaard2
2019-6-2 17:39:14

So only “mysql_native_password” is supported.


greg
2019-6-2 18:13:57

@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


greg
2019-6-2 18:14:23

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


greg
2019-6-2 18:15:00

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


soegaard2
2019-6-2 18:15:53

Thanks for looking at this.


greg
2019-6-2 18:15:53

Sounds like a new feature request for db/mysql


soegaard2
2019-6-2 18:16:22

I found this in the mysql docs:



greg
2019-6-2 18:16:36

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


soegaard2
2019-6-2 18:17:06

Maybe I should try postgres instead.


soegaard2
2019-6-2 18:17:25

The option file mentioned in the MySQL is simple enough:


soegaard2
2019-6-2 18:17:33
[mysqld]
default_authentication_plugin=mysql_native_password

soegaard2
2019-6-2 18:17:45

they don’t mention where it is located …


greg
2019-6-2 18:17:56

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


soegaard2
2019-6-2 18:17:58

or the file name for that matter.


soegaard2
2019-6-2 18:18:27

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


greg
2019-6-2 18:19:17

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.


greg
2019-6-2 18:20:09

(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.)


soegaard2
2019-6-2 18:21:24

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.


greg
2019-6-2 18:21:55

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


greg
2019-6-2 18:22:13

Which can access TCP ports, you should assume.


soegaard2
2019-6-2 18:23:11

Good point.


soegaard2
2019-6-2 18:23:58

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


greg
2019-6-2 18:26:09

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.


soegaard2
2019-6-2 18:26:23

Thanks.


greg
2019-6-2 18:26:56

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


greg
2019-6-2 18:28:36

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


soegaard2
2019-6-2 18:29:28

Yeah, need to make dinner too.