Skip to main content

Accessing an Oracle database using .Net, NodeJS, PHP and Python

· 10 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Accessing an Oracle database using .Net, NodeJS, PHP and Python

In a previous article (Running Oracle Database Server as a Docker container), we've created a Docker container called oracle-db where a Human Resources database is running.

This time, let's play with .Net, NodeJS, PHP and Python to access to it and display records.

For each language, we'll build a Docker image with all the required stuff like Oracle Instant Client then we'll create a small script to connect to the employees table and display records.

The idea is then to provide a very quick skeleton for starting a project in those languages and if you need to directly connect to an Oracle database.

Transform an Oracle DB as OpenData using Oracle REST Data Services

· 12 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Transform an Oracle DB as OpenData using Oracle REST Data Services

In a previous article (Running Oracle Database Server as a Docker container), we've created a Docker container called oracle-db where a Human Resources database is running.

In this article we'll partially expose the database on the web using OpenAPI so, in short, we'll allow allowed people to access to, f.i., http://oursite/api/employees to get the list of all employees.

Exactly the same way we've done with PostgREST (see my Don't query your PostgreSQL db anymore, prefer PostgREST) but, this time, with an Oracle database.

And the magic will happen thanks Oracle REST Data Services aka ords.

Running Oracle Database Server as a Docker container

· 14 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Running Oracle Database Server as a Docker container

At work, I had to create an Oracle Enterprise database locally so that I could code scripts in different languages to show how to connect to Oracle using, for example .Net, NodeJS, Python or PHP.

So the idea was immediately to check whether there was an official image for this. And there is one but, damned, it's not as simple as for PostgreSQL, MySQL, MS SQL Server.

In this article, which is a clean-up of my notes, we're going to install Oracle Enterprise locally in a container, create a database with example data and access the database in several ways.

It's a step-by-step guide to make life easier for anyone who needs to do the same thing - me, for example, in a few months' time when I've forgotten everything.

Introduction to Cypress

· 9 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Introduction to Cypress

You've created a website for yourself or for a client, and how can you be sure that it will works? OK, at the time you were working on it, of course it was working; the search form, the contact form, the various links were all functional, but how can you be sure of this over time? Wouldn't it be useful to have a procedure that would allow you to run several so-called ‘functional’ tests to check that everything is still working? This could be part of the maintenance contract you offer your customer.

What tool should you use for this type of requirement?

Cypress is a front-end testing tool that empowers developers to automate functional tests directly within the browser. It enables actions like navigating web pages, interacting with elements, submitting forms, and asserting content or URL changes, streamlining end-to-end and integration testing.

In june 2024, I've written an article about a PHP functional test tool called Behat, let's see how to proceed with Cypress which is a Javascript tool.

Laravel Telescope

· 2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Laravel Telescope

I don't work as often with Laravel (one of the most famous PHP frameworks) so I'm losing my reflexes a bit when it comes to debugging the code, e.g. when it comes to finding the queries that have been executed, the exceptions that have been thrown, the list of keys that have been created or read from the Redis cache, etc.

By installing Laravel Telescope, we can get realtime information about cache, logs, queries and models, exceptions, ... and this will help a lot to understand how the application is working and what is running.

Telescope is a great help for debugging and understanding your application, and installs like a dev dependency.

The last time I developed a Laravel application and installed it on the test server, I was able to follow what my user was doing in real time, see the exceptions he encountered and correct them ... even before he reported them to me.

Thanks to Telescope, not only did I have a perfect view of what was being collected, but I also had all the context: the user didn't have to tell me ‘That doesn't work...’. (without any details); I had everything at hand.

MS Excel - Connect to a SQL Server database, run a query and get the results - Step by step

· 8 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

MS Excel - Connect to a SQL Server database, run a query and get the results - Step by step

In April 2024, I wrote a small blog post about a VBA script that will connect to a MS SQL database, run a SELECT query to retrieve data and put them in an Excel worksheet.

Let's rewrite this article in a full tutorial. We'll install run a SQL Server database using Docker, download MS SQL Server Management Studio, connect to our SQL Server, create a new database with dummy data and, finally, in Excel, retrieve the list of our customers.

Todo Tree in VSCode

· 2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Todo Tree in VSCode

When you're working on a large codebase, soon or later you'll find some annotations like @TODO or // TODO put there by people (perhaps you) as a reminder for "Don't forget to (do something)...". And, for sure, these todos remain there months or years because, yup, the programmer forgot they were there.

Personally, I sometimes work on code and comment on the call to a particular method or block. Often during a debugging session (for example on Linux Bash scripts) but, danger, don't forget to remove the comments and return the code to its original state. In that situation, I add a comment like // TEMPORARY just before the first commented line.

The idea behind the Todo Tree vscode addon (you can find the download page here) is to summarise such annotations and display a dashboard with all TODOS, TOFIX, ... and your owns too.

Enable case sensitivity for filenames under DOS

· 2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Enable case sensitivity for filenames under DOS

This is just ... for fun.

As you know, MS DOS didn't make any differences between MyFile.txt, myfile.txt, MYFILE.txt since DOS isn't case sensitive.

If you don't believe me, just start notepad, type a few characters and save your work once as MyFile.txt then as myfile.txt then as MYFILE.txt. Then look to your folder, how many documents did you have ? Just one.

Under Linux, you would have had three files; not under DOS.

What if we asked DOS to change its ways?

MS Office - Load dropdown from Excel's range

· 6 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

MS Office - Load dropdown from Excel's range

In this article, we'll see how, very easily, we can load an Excel range into a ribbon and display it inside a dropdown.

The idea is to provide a list of values in a ribbon but to not have to hardcode values in the list but, just, to link to a range, anywhere in your workbook.

I've used this technique in many of my Excel application's (i.e. Excel having VBA code).

For this blog post, we'll create a list of periods (YYYYMM) in a worksheet and load that list in our custom ribbon.

In this way, we could offer a nicer user experience by proposing a list and executing, for example, a query to a database to obtain the data for this period (or anything else).

SSH - Autosuggestions with ZSH

· 3 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

SSH - Autosuggestions with ZSH

A few weeks ago, I've posted a SSH - Launch a terminal on your session without having to authenticate yourself article about the ssh command in Linux.

I'm pretty sure, like me, you are tired to use command line like ssh christophe@1.2.3.4 to start a ssh connection because ... you know, you don't need to connect on a server; no, you need to connect to the server where the application is running; you know the name of the MyAmazingApp application but certainly not the name of the server or its IP.

That's the case for me anyway.

So, I need to connect to my vault, in which I list all the information about applications, server names, credentials to be used, ...

It would be pretty cool to run ssh MyAmazingApp no?