You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you've never heard of GitHub Codespaces before, I hope that you will leave this post wanting to try it.
As a preface: I do all of my development in VS Code on my local machine. I write mostly Node.js, COBOL, and RPG. That is my day-to-day. What this post will show is how you can achieve it with GitHub Codespaces. It may also be possible with Python too, but I didn't try that.
GitHub Codespaces is Visual Studio Code but in the browser, made for managing repositories on GitHub. But because a codespace gives you access to an entire Linux environment, you can do what you want with it. And because it's VS Code, you get access to all the extensions available.
Create an empty repository on GitHub with an initial file (a readme is fine!)
Click the big green button that says 'Code'
Go onto the Codespaces tab
Click 'New codespace'
Connection notes
I am quite aware that a majority of users run their IBM i behind a VPN. As of right now, GitHub Codespaces does not allow users to configure a VPN for their codespace to use (though it is possible to actually do it, that is another post). I did read that Azure Codespaces may allow this in the future (for those using Azure and its network features) which might allow you to reach out to your IBM i instances.
If you're just trying this, pub400 works perfectly fine to play with.
Welcome to the future, because you can now write all of your COBOL, RPG and other ILE languages directly in the cloud. How cool! First, you need the Code for IBM i extension. This is free for everyone. You can find it on the Marketplace:
Following the installation, you can connect to your system:
After you've connected successfully, you can use Code for IBM i just like you would normally - except in a browser!
Writing a Node.js app is awesome and the fact we can now write a Node.js app that talks to IBM i is even better for me!
Node.js takes a bit of setup to get going when working with the ODBC driver, so we need the following things:
IBM i ODBC driver for Linux
unixodbc
odbc
First go and download the 'ACS Linux App Pkg' from the IBM website.
When the .zip has been downloaded, you want to extract it to find the .deb inside: It is at ./x86_64/ibm-iaccess-1.1.0.15-1.0.amd64.deb, though you may have a different version. You are able to upload files right into the Codespace. You can go to the Explorer panel, right click and select 'Upload':
You should select the file mentioned above and then see it appear in the directory in the Codespace.
Next, for the real installation steps. You need to run these commands in the Terminal with the Codespace. You can open the Terminal by pressing Control / Command + J, and selecting Terminal.
installs the file we uploaded, which is the IBM i ODBC driver.
npm i odbc
this will fetch the ODBC module from npm and likely build it automatically. Luckily, Codespaces has all the build tools preinstalled so we don't have to worry about anything!
Now you're ready to write some Node.js! Here's an example script I used to test ODBC and it worked great!
constodbc=require('odbc');asyncfunctionconnectToDatabase(){constconnectionString=[`Driver=IBM i Access ODBC Driver`,`System=${process.env.DB2_SYSTEM}`,`UID=${process.env.DB2_UID}`,`Password=${process.env.DB2_PASSWORD}`,`DBQ=,*USRLIBL`,`Naming=1`,].join(';');constconnection=awaitodbc.connect(connectionString);// connection1 is now an open Connectionconstresults=awaitconnection.query('SELECT * FROM SAMPLE.DEPARTMENT');console.log(results);}connectToDatabase();
The text was updated successfully, but these errors were encountered:
If you've never heard of GitHub Codespaces before, I hope that you will leave this post wanting to try it.
As a preface: I do all of my development in VS Code on my local machine. I write mostly Node.js, COBOL, and RPG. That is my day-to-day. What this post will show is how you can achieve it with GitHub Codespaces. It may also be possible with Python too, but I didn't try that.
GitHub Codespaces is Visual Studio Code but in the browser, made for managing repositories on GitHub. But because a codespace gives you access to an entire Linux environment, you can do what you want with it. And because it's VS Code, you get access to all the extensions available.
See more about GitHub Codespaces on its website.
Setting up a Codespace
Connection notes
I am quite aware that a majority of users run their IBM i behind a VPN. As of right now, GitHub Codespaces does not allow users to configure a VPN for their codespace to use (though it is possible to actually do it, that is another post). I did read that Azure Codespaces may allow this in the future (for those using Azure and its network features) which might allow you to reach out to your IBM i instances.
If you're just trying this, pub400 works perfectly fine to play with.
June 2022 update: OpenVPN is a working option when using a Codespace or GitPod: https://github.com/codespaces-contrib/codespaces-openvpn
COBOL, RPG, and traditional IBM i development
Welcome to the future, because you can now write all of your COBOL, RPG and other ILE languages directly in the cloud. How cool! First, you need the Code for IBM i extension. This is free for everyone. You can find it on the Marketplace:
Following the installation, you can connect to your system:
After you've connected successfully, you can use Code for IBM i just like you would normally - except in a browser!
See more about Code for IBM i here.
Node.js
Writing a Node.js app is awesome and the fact we can now write a Node.js app that talks to IBM i is even better for me!
Node.js takes a bit of setup to get going when working with the ODBC driver, so we need the following things:
First go and download the 'ACS Linux App Pkg' from the IBM website.
When the
.zip
has been downloaded, you want to extract it to find the.deb
inside: It is at./x86_64/ibm-iaccess-1.1.0.15-1.0.amd64.deb
, though you may have a different version. You are able to upload files right into the Codespace. You can go to the Explorer panel, right click and select 'Upload':You should select the file mentioned above and then see it appear in the directory in the Codespace.
Next, for the real installation steps. You need to run these commands in the Terminal with the Codespace. You can open the Terminal by pressing Control / Command + J, and selecting Terminal.
sudo apt install unixodbc
sudo apt install ./ibm-iaccess-1.1.0.15-1.0.amd64.deb
npm i odbc
Now you're ready to write some Node.js! Here's an example script I used to test ODBC and it worked great!
The text was updated successfully, but these errors were encountered: