InseeFrLab / utilitR

Source of the utilitR French R documentation
https://book.utilitr.org/
Other
75 stars 57 forks source link

Fiche sur les bases de données - [merged] #136

Closed linogaliana closed 3 years ago

linogaliana commented 3 years ago

In GitLab by @linogaliana on Apr 11, 2020, 08:34

_Merges fichesgbd -> master

J'ouvre la MR pour faciliter le processus de review (promis moins de spam que sur !27 )

Close #37

linogaliana commented 3 years ago

In GitLab by @pierre-lamarche on Apr 19, 2020, 09:59

Commented on 03_Fiches_thematiques/Fiche_connexion_bdd.Rmd line 107

changed this line in version 23 of the diff

linogaliana commented 3 years ago

In GitLab by @pierre-lamarche on Apr 19, 2020, 09:59

Commented on 03_Fiches_thematiques/Fiche_connexion_bdd.Rmd line 176

changed this line in version 23 of the diff

linogaliana commented 3 years ago

In GitLab by @pierre-lamarche on Apr 19, 2020, 09:59

added 1 commit

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 19, 2020, 11:58

added 6 commits

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 19, 2020, 14:14

added 2 commits

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 19, 2020, 14:20

added 1 commit

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 19, 2020, 14:27

added 1 commit

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 19, 2020, 14:37

added 1 commit

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 19, 2020, 14:55

added 1 commit

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 19, 2020, 14:59

added 1 commit

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @pierre-lamarche on Apr 19, 2020, 15:34

added 2 commits

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @pierre-lamarche on Apr 19, 2020, 16:48

added 1 commit

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 05:58

added 2 commits

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 06:09

approved this merge request

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 06:23

added 2 commits

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 06:23

approved this merge request

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 06:24

@linogaliana, @RLesur : que pensez-vous de la fiche en l'état?

Pierre et moi pensons que nous ne sommes pas loin de pouvoir la merger.

linogaliana commented 3 years ago

In GitLab by @linogaliana on Apr 20, 2020, 07:25

Je valide ! :thumbsup:

linogaliana commented 3 years ago

In GitLab by @linogaliana on Apr 20, 2020, 07:26

resolved all threads

linogaliana commented 3 years ago

In GitLab by @linogaliana on Apr 20, 2020, 07:27

unmarked as a Work In Progress

linogaliana commented 3 years ago

In GitLab by @linogaliana on Apr 20, 2020, 07:27

changed the description

linogaliana commented 3 years ago

In GitLab by @linogaliana on Apr 20, 2020, 07:29

@oliviermeslin comme j'ai créé la MR je ne peux pas l'approuver mais @pierre-lamarche (ou @RLesur ) doit pouvoir le faire pour atteindre le quorum nécessaire

linogaliana commented 3 years ago

In GitLab by @pierre-lamarche on Apr 20, 2020, 07:29

approved this merge request

linogaliana commented 3 years ago

In GitLab by @gillesfidani on Apr 20, 2020, 08:50

added 3 commits

Compare with previous version

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 08:50

approved this merge request

linogaliana commented 3 years ago

In GitLab by @pierre-lamarche on Apr 20, 2020, 08:56

approved this merge request

linogaliana commented 3 years ago

In GitLab by @gillesfidani on Apr 20, 2020, 08:58

approved this merge request

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 08:59

mentioned in commit 917b8387b36d7a645e23e91bcb4e8cd6e901f306

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 08:59

merged

linogaliana commented 3 years ago

In GitLab by @RLesur on Apr 20, 2020, 13:56

Commented on 03_Fiches_thematiques/Fiche_connexion_bdd.Rmd line 112

Dites, êtes-vous certains que les arguments de la méthode dbConnect() pour les objets de classe OdbcDriver prennent bien des initiales en majuscule ?
Je n'utilise pas le package odbc, mais si je comprends bien, l'objectif de mettre des majuscules est de passer ces arguments au dots argument pour qu'ils soient rajoutés à la chaîne de connexion, c'est bien ça ?

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 14:43

Commented on 03_Fiches_thematiques/Fiche_connexion_bdd.Rmd line 112

Alors j'ai réussi à me connecter à une base de données PostgreSQL avec le code suivant:

conn <- DBI::dbConnect(
  odbc::odbc(),
  driver = "PostgreSQL Unicode(x64)",
  server = "bspocimmoldb01.ad.insee.intra",
  database = "ri_pg_pocimmo_bs01",
  port = 1983,
  uid =  rstudioapi::askForPassword("Nom d'utilisateur"),
  pwd = rstudioapi::askForPassword("Mot de passe"))

Ca marche aussi avec le nom des arguments en majuscules. Est-ce que ça répond à ta question?

linogaliana commented 3 years ago

In GitLab by @RLesur on Apr 20, 2020, 15:36

Commented on 03_Fiches_thematiques/Fiche_connexion_bdd.Rmd line 112

Oui, en grande partie. En fait, ce qui m'avait intrigué, c'était en lisant la page d'aide suivante :

?`dbConnect,OdbcDriver-method`

dans laquelle on voit que tous les arguments sont en minuscules.

Je pense que même si ça donne le même résultat, la mécanique n'est pas tout à fait la même. Dans le cas où les arguments sont en majuscule, ils sont tous passés à l'argument ... alors qu'avec les minuscules, ce sont les arguments de la méthode dbConnect() pour l'objet de classe OdbcDriver qui sont renseignés.

Si les deux fonctionnent, tant mieux !

Cependant, en tant que lecteur, j'aurais une petite préférence pour l'utilisation des arguments en minuscule. Je vous laisse voir et décider !

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 15:57

Commented on 03_Fiches_thematiques/Fiche_connexion_bdd.Rmd line 112

je suis d'accord, je le fais

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 16:11

Commented on 03_Fiches_thematiques/Fiche_connexion_bdd.Rmd line 112

Fait avec bade2864

linogaliana commented 3 years ago

In GitLab by @oliviermeslin on Apr 20, 2020, 16:11

resolved all threads

linogaliana commented 3 years ago

In GitLab by @pierre-lamarche on Apr 20, 2020, 19:10

Commented on 03_Fiches_thematiques/Fiche_connexion_bdd.Rmd line 112

En effet, dans ce cas, c'est mieux avec les minuscules. Je m'étais calé sur la documentation de RStudio : https://db.rstudio.com/databases/postgresql/#connection-settings sans en interroger la qualité. Merci pour la précision.

linogaliana commented 3 years ago

In GitLab by @RLesur on Apr 21, 2020, 07:30

Commented on 03_Fiches_thematiques/Fiche_connexion_bdd.Rmd line 112

Je pense que c'est parce que cette doc n'a pas été mise à jour. En effet, il fut un temps où il fallait utiliser les majuscules : https://github.com/r-dbi/odbc/blob/8c0d3ec61ad7b46d8c6c05cfcaacd3719b58e70b/R/Connection.R.

Mais depuis https://github.com/r-dbi/odbc/commit/728aebae136965abbf82bd73ea40a8132ad48b4c#diff-e1e1d3d40573127e9ee0480caf1283d6, les arguments ont été ajoutés.