Can we enable tls 1.0 on MSSQL Server 2019 on database level? if yes then how?

i am running sql server 2019 on Linux box and trying to connect using a Windows server 2016 client, how can we enable TLS 1.0 for SQL Server 2019 on the Database/instance level.

TIA.

mysql – Change woocommerce order status by database change

I have a dropshipping client who uses Delphi in his company. He connected his system to my wordpress database and can read and write it.
The WordPress site runs on a windows server.

How can I make sure that when he makes specific changes in the database the order will be changed by script? (processing -> completed)

In the first place I would use the php/javascript/python api, but how can I make sure it will be triggered automatically by his database connection?

The best solution would be if the database change alone triggers the order status change with all its functions, like customer email etc.

My ideas would be:

  1. Scheduler on windows server who notices changes and runs something
  2. Zapier.com mysql/WooCommerce connection
  3. Provide the scripts to let him run the scripts on his system by himself

What are your ideas for a stable and reliable solution?

No hate please im a beginner. I appreciate any ideas and solutions.

Thank you

architecture – How do I architect reordering in database?

I’m building a todo list app and using react-beautiful-dnd on the frontend to allow users to reorder tasks. I’m trying to work out how to persist changes to the database when a user reorders items.

With react-beautiful-dnd, when a reorder occurs, there’s an onDragEnd callback which provides me with the following information:

{
  "draggableId": "ckfh7msol0005twuz82i2k7oo",
  "type": "DEFAULT",
  "source": {
    "index": 0,
    "droppableId": "droppable"
  },
  "reason": "DROP",
  "mode": "FLUID",
  "destination": {
    "droppableId": "droppable",
    "index": 1
  },
  "combine": null
}

I’ve only seen examples that show how to persist the change in React state, which is just a case duplicating the array of items, reordering based on start and end indexes and setting the state as the result of that, something like this:

const onDragEnd = (dropResult: DropResult) => {
  const { destination, source } = dropResult

  if (!destination) {
    return
  }

  if (destination.droppableId === source.droppableId && destination.index === source.index) {
    return
  }

  const result = Array.from(tasks)
  const (removed) = result.splice(source.index, 1)
  result.splice(destination.index, 0, removed)
  const reorderedTasks = result.splice(destination.index, 0, removed)

  setTasks(reorderedTasks)
}

The todo items are coming from a call to the server via Apollo Client, so I guess what I’d want to do, rather than setting the state with the result, is send a mutation to reorder the items in the database and the refresh the client with the updated data.

I’m not sure what the best way to do this is. I’ve seen some suggestions around having e.g. an integer order property on each todo item and when a reorder occurs, adjust the order numbers of each todo item until everything is in the right numerical order.

Another approach I’ve come across is to use e.g. a floating point order property on each item, and then doing the math based on the order of the item above and below the target position so the the order is in-between.

Basically I’m wondering which route I should go down and how to implement it in the cleanest way.

I’m using Prisma and graphql-yoga on the backend with a sqlite database.

sql server – The database is not accessible (ObjectExplorer) on Secondary Node

I have Microsoft SQL Server 2016 (SP2-CU13) AlwaysOn with 2 nodes , on the first node I can execute the queries, but On secondary node when I trying to execute query or just open a DB to see the tables I getting error:

"The Database XX is not accessible. (ObjectExplorer)"

Please advise

Thanks

javascript – how can i make checkbox to not remove tick on page refresh when checked and have the checkbox update the complete field in my database table

I am creating a todo list app in flask python and mysql as my school assignment. problem is i have a “complete” field on my task form and in my db, when i click the checkbox on the form to check it as complete and refresh my web page it goes back to default unchecked and doesn`t update the db.

here is my checkbox:

<td>
        <div class="checkbox-container">
          <input id="chkDone" name="done" type="checkbox"> Mark as Done <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
        </div>
      </td>

and here is my inline Js:

<script>
function check() {
  document.getElementById("chkDone").checked = true;
}

function uncheck() {
  document.getElementById("chkDone").checked = false;
}
</script>

database – Integration of Azure with Oracle Cloud Infrastructure (OCI) ORA-03113: end-of-file on communication channel

I’m trying to integrate Azure and OCI using this approach and this article.

Now, I have the infrastructure up and running. It consists of a VM in Azure, an Autonomous Database (ATP) Oracle Cloud Infrastructure (OCI), and a Java application on the VM. The application successfully connected to the database.

However, after some period of time application fails with:

ORA-03113: end-of-file on communication channel

Process ID: 86437

Session ID: 57114 Serial number: 29955

How can I identify where is the problem (Azure, OCI, etc.) in order to have an idea of how to fix it?

database – Mysql replication for specific commands only?

Is there any way to setup mysql master-slave replication using log-bin for some specific commands only?

Suppose I want to replicate everything which is SELECT or UPDATE but not DELETE?

Is there any way that DELETEs do not get replicated on the slave.

object oriented – Caching the result of a query to the database

When rendering a page, a heavy query to the database is performed. My task is to cache the queryset obtained in the query and use it later. If 5 seconds have passed since the last initialization of the cache during the next cache query, the old cache should be removed and new data should be written from the database.

Now I have written the logic without taking into account the timing, and further I have a problem with understanding how to connect the timer.

class BlacklistCache:
    CACHE_INITIAL_TIME = 0

    def __init__(self):
        self._cache = None

    @property
    def cache(self):
        if time.time() - 5 > self.__class__.CACHE_INITIAL_TIME:
            self.__class__.CACHE_INITIAL_TIME = time.time()
            self._cache = None
        return self._cache

    @cache.setter
    def cache(self, value):
        self._cache = value


blacklist_cache = BlacklistCache()


def check_blacklist_cache(item_type):
    if blacklist_cache.cache:
        print('Exist')
        return blacklist_cache.cache
    else:
        print('New')
        blacklist = BlacklistedItem.objects.filter(item_type=item_type).values_list('item_id', flat=True)
        blacklist_cache.cache = blacklist
    return blacklist_cache.cache

But in the end the first time the page is loaded New is printed, and on all future loads Exist is printed and cache is not overwritten. I assumed that this code

if blacklist_cache.cache:

would call the get method from the instance, but it doesn’t. Could you get me any advice, or maybe most efficient approach?

sql server – Which database to use when you have a 6 billion of rows inside and need to query rows with from list of IDs?

We are currently researching our case of storing the distances between cities. Right now we have 6 billion of those distances.

Our structure right now in SQL Server is that we have a column that represents a float number which represents the relationship between cities.

So here is what I mean, we have a city with ID 1 inside the Locations table and a city with ID 2 inside the same table, a row with distance from 1 to 2 will look like so 1.21000 miles. That column is indexed.

So as an example we need to get the distance from the city 1000 to the city 2535, we need to find 1000.2535 inside the Distances table to get that distance.

Besides that example, we need to select 1000 rows with a generated list of 1000 IDs from those 6 billion rows. What I mean is SELECT id, distance FROM Distances WHERE id IN (1000.2535, 1.2, etc.)

Right now we’ve only tested SQL Server on a local machine and it gives us around 300 ms for such query of 1000 rows, but only when we set a 50 ms timeout (this is needed for a lot of parallel requests from multiple users), if 50 ms timeout is not used it just grows exponentially like 300 ms for the first, 500 ms for the second, 800 ms for the third, etc.

And right now we taking a look at ElasticSearch specifically for mget.

So my questions are:

  1. Which database would you recommend for such a use case?
  2. What would you recommend besides what we’ve thought of maybe some other ideas like splitting into two different columns cities IDs, etc?
  3. What would be the best ways to optimize such a database?

8 – How do I create a select field that looks up values from a database?

As the title says. How would I go about setting up a ‘lookup’ function to essentially allow a user to select values from a select or dropdown field (for example), where these values are stored in a database.

I know my way around the Webform module to a decent level but cannot see any options/settings to set up this kind of functionality, given it is quite a common requirement for forms.

The ‘Add webform options’ isn’t something I can use, as there are numerous values, too many to enter manually.

Any help would be appreciated!